Skip to content

Connection doesn't time out when using SSL #55

Closed

Description

@flip111

This is in support of phergie/phergie-irc-bot-react#42

i noticed the code never goes into this line https://github.com/reactphp/socket-client/blob/v0.4.4/src/SecureConnector.php#L22 because there is isn't a write event coming while it seems to be waiting for that https://github.com/reactphp/socket-client/blob/v0.4.4/src/Connector.php#L58

can someone confirm this and also explain why a write event is expected and what kind of write event is suppose to trigger this?

Activity

  1. clue commented on Dec 5, 2015

    @clue
    Contributor

    can someone confirm this […]

    Yes, lack of proper timeout support is a known issue. Note however that this is unrelated to SSL/TLS, so in your case it looks like the underlying TCP/IP connection already times out.

    FWIW: Your OS will likely still implement a timeout for the socket, though we currently offer no API to change this value. It will likely be anywhere between a few minutes or hours, which is likely way beyond what most applications want.

    See also PR #51 for a possible implementation.

    explain why a write event is expected and what kind of write event is suppose to trigger this?

    This is the normal async socket connection approach: Open the underlying socket resource, set it to non-blocking mode and start the connection. Once the socket descriptor becomes writable it means we can check if the connection has either been accepted or rejected.

    Because we currently offer no custom timeout handling, we currently rely entirely on the OS timeout. This means the "write" event will actually trigger eventually, you're probably just not patient enough :-)

    Let's look into finally getting #28/#51 in! :shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions