Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection doesn't time out when using SSL #55

Closed
flip111 opened this issue Nov 30, 2015 · 1 comment
Closed

Connection doesn't time out when using SSL #55

flip111 opened this issue Nov 30, 2015 · 1 comment

Comments

@flip111
Copy link

flip111 commented Nov 30, 2015

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?

@clue
Copy link
Contributor

clue commented Dec 5, 2015

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:

@clue clue closed this as completed Dec 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants