Opened 11 years ago
Closed 11 years ago
#1017 closed defect (fixed)
socket-receive blocks for connectionless sockets
Reported by: | Jim Ursetto | Owned by: | Jim Ursetto |
---|---|---|---|
Priority: | major | Milestone: | someday |
Component: | extensions | Version: | |
Keywords: | socket egg | Cc: | |
Estimated difficulty: |
Description
klm identified a bug in the socket egg; nonblocking mode is only set during a socket-connect or socket-accept, which won't be called for UDP. Test case attached.
Temporary workaround: (use posix) and then, after creating the socket, do either:
(##sys#file-nonblocking! (socket-fileno *socket*))
or equivalently
(file-control fcntl/setfl (socket-fileno *socket*)
(bitwise-ior (file-control fcntl/getfl (socket-fileno *socket*))
open/nonblock))
Neither workaround will work on Windows.
Permanent fix: We should probably make all sockets nonblocking at creation time instead, since our machinery assumes nonblocking sockets. We could expose the set-nonblocking operation to the user, but since TCP is always nonblocking, doing this only for UDP would be strange.
Attachments (1)
Change History (2)
Changed 11 years ago by
Attachment: | socket-recv-udp.scm added |
---|
comment:1 Changed 11 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in socket 0.2.3.