Uh oh!
There was an error while loading. Please reload this page.
Connections now resolve with a ConnectionInterface - #82
Conversation
clue
commented
Feb 16, 2017
Note that this It is believed this is a good thing currently, because we aim to avoid inter-package dependencies. In the future, we will look into merging these into a single package again, in order to avoid confusion. This debate is best left out of this PR, be assured I'll file new tickets and link here if this ticket is accepted 👍 |
clue
commented
Feb 16, 2017
See #86 for future plans to merge this into the Socket component. |
This PR changes the resolution value from
Stream(which implements theDuplexStreamInterface) to an instance implementing the newConnectionInterface, which in turn implements theDuplexStreamInterface.In other words: Each
ConnectorInterfacenow has aconnect()method that resolves to aConnectionInterface.Because the
ConnectionInterfaceimplements the same base interfaceDuplexStreamInterface, it behaves just like a normal stream resource, so consumer code can simply use the new typehint and continue to work unchanged.The
ConnectionInterfacealso implements two new methods which are not available for the underlying stream:getRemoteAddress(): ?stringgetLocalAddress(): ?stringResolves / closes#44
Refs reactphp/reactphp#199
Refs reactphp/socket#65
Refs reactphp/socket#68