-
Notifications
You must be signed in to change notification settings - Fork 0
Use of connect syscall should support non-blocking #159
Comments
I suggest this be fixed for 0.0.4. Launchpad Details: #LPC Derick Eddington - 2008-12-30 05:01:09 -0500 |
Attached is a program that demonstrates the problem of Here's its output showing it block the server: [d@eep: Here's its output after the patch is applied: [d@eep: Launchpad Details: #LPC Derick Eddington - 2009-01-05 01:07:00 -0500 |
The patch attached to this bug report applies successfully to the The patch from bug report #313852 (the 2nd non-typo one, My patch program is able to successfully apply both: [d@eep: The 2 failed hunks are the 2 lines I mentioned above and can be Launchpad Details: #LPC Derick Eddington - 2009-01-05 01:20:36 -0500 |
JTMI, the example connects to a host name and so does a potentially blocking DNS look-up. If an IP address instead was used (which would not cause a DNS look-up), the example would still have the problem of the connect syscall blocking. A real nonblocking application would use asynchronous DNS, which I hope can be made with Ikarus's nonblocking UDP support (I haven't looked into it yet). Launchpad Details: #LPC Derick Eddington - 2009-01-09 13:23:27 -0500 |
Currently, the call to connect in do_connect in ikarus-io.c will block until the connection attempt succeeds or fails. I suggest that it not block when used via {tcp,udp}-connect-nonblocking. This is especially necessary for P2P programs designed around non-blocking sockets. Attached is a patch to do this.
(There's also a couple other minor changes: use io-error instead of die in two spots; check for EWOULDBLOCK also which is necessary for the accept syscall)
Launchpad Details: #LP258984 Derick Eddington - 2008-08-18 00:29:22 -0400
The text was updated successfully, but these errors were encountered: