Summary
socket-receive blocks for connectionless sockets
Metadata
- Id: 598a3600f5cc5ec9b88f11684f81c7522c01f5f4
- Trac id: 1017
- Type: defect
- Reporter: zbigniew
- Owner: zbigniew
- Cc:
- Status: closed
- Component: extensions
- Estimated difficulty:
- Resolution: fixed
- Priority: major
- Milestone: someday
- Version:
- Changetime: 2013-06-15 16:17:56 UTC
- Created: 2013-06-14 22:27:38 UTC
- Keywords: socket egg
Attachments
- 598a3600f5cc5ec9b88f11684f81c7522c01f5f4/attachments/socket-recv-udp.scm
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.
Changes and comments
[2013-06-14 22:27:56 UTC] zbigniew attached socket-recv-udp.scm (description=#f)
[2013-06-15 16:17:56 UTC] zbigniew changed status from new to closed
[2013-06-15 16:17:56 UTC] zbigniew set resolution to fixed
[2013-06-15 16:17:56 UTC] zbigniew wrote:
Fixed in socket 0.2.3.