Summary

socket-receive blocks for connectionless sockets

Metadata

Attachments

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.