Homec4science

Make PhutilSocketChannel work better for channels with separate I/O

Authored by epriestley <git@epriestley.com> on Dec 19 2012, 01:34.

Description

Make PhutilSocketChannel work better for channels with separate I/O

Summary:
Currently, all uses of PhutilSocketChannel are protocol-based or terminate the read and write socket at the same time (e.g., when the other side terminates).

However, when receiving an SSH request, we sometimes to read all of stdin until the socket hits EOF and closes, but then may still want to write a response out. Allow PhutilSocketChannel to close just half of the channel (read or write) without also closing the other half. Also, provide specific tests for a channel being open for reading and writing.

Also, implement PhutilMetricsChannel, which just counts bytes that go through it. Eventually, this will count I/O over SSH and feed into some system which keeps track of how much stuff we're using.

Test Plan: See next diff; implemented SSH glue on top of this.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603, T550

Differential Revision: https://secure.phabricator.com/D4228

Details

Committed
epriestley <git@epriestley.com>Dec 19 2012, 01:34
Pushed
aubortMar 17 2017, 12:03
Parents
rPHU908cce381890: Use PhutilURI in ConduitClient
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU870bcc764344: Make PhutilSocketChannel work better for channels with separate I/O (authored by epriestley <git@epriestley.com>).Dec 19 2012, 01:34