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)

socket-recv-udp.scm (648 bytes) - added by Jim Ursetto 11 years ago.

Download all attachments as: .zip

Change History (2)

Changed 11 years ago by Jim Ursetto

Attachment: socket-recv-udp.scm added

comment:1 Changed 11 years ago by Jim Ursetto

Resolution: fixed
Status: newclosed

Fixed in socket 0.2.3.

Note: See TracTickets for help on using tickets.