-
Notifications
You must be signed in to change notification settings - Fork 157
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
Update TIdIOHandler.ConnectTimeout logic #3
Comments
Alternatively, update |
From duplicate #466
|
I don't really care about small implementation details :), the idea is that matters. |
There is currently nothing in Indy that waits for a socket to be in a writable state before writing data to it, Indy just writes and lets it block as needed. Indy is designed around blocking I/O, not non-blocking I/O. So, there just hasn't been any need for a high-level wrapper to call That being said, Indy does expose one way to call |
Apparently, a recent change in Linux now prevents one thread from disconnecting a TCP socket if other threads are waiting on the socket! This does not bode well for Indy, which expects to be able to shutdown/close a TCP socket while threads are blocked on socket I/O operations. For this ticket, this change means that using Will have to review other socket functions for potential problems introduced by this change. |
Update TIdIOHandler to pass its
ConnectTimeout
value all the way toTIdStack.Connect()
to get the timeout logic out ofTIdIOHandler.ConnectClient()
. This way,TIdStackWindows
can be updated to useWSA...()
functions when available (ie,WSAConnectByName()
orWSAConnectByList()
, which both have atimeout
parameter), and thus avoid having to use theTIdConnectThread
class to abort the connection after the timeout elapsed. OtherTIdStack...
classes can continue usingTIdConnectThread
when suitable platform-specific techniques are not available.The text was updated successfully, but these errors were encountered: