Redesign TIdTCPClient connect with timeout without extra thread... #466
Labels
Element: I/O Handlers
Issues related to TIdIOHandler and descendants
Element: Socket Stacks
Issues related to OS socket APIs, TIdStack and TIdSocketList descedants, etc
Element: TCP
Issues related to TCP handling, TIdTCPClient and TIdTCPServer descendants, etc
Status: Duplicate
Issue is a duplicate of another issue
Type: Enhancement
Issue is proposing a new feature/enhancement
I have an application where I need a very short connect timeout.
Then I just saw that Indy starts a new thread for this connect ...!?
I took the time to implement a version based on non blocking connect and select... see attached patch.
The idea is to split TIdSocketHandle.Connect into GStack.Connect (which starts an non-blocking connect) and later UpdateBinding.
The code in TIdIOHandlerStack.ConnectClient just starts connect then waits with select (write) and then decides to UpdateBinding or raise exception.
I also added the TIdSocketListWindows.SelectWrite... why was it not yet included??
It's just a prof of concept code, no AntiFreeze and no posix variant.
indy_asyc_connect.patch
The text was updated successfully, but these errors were encountered: