[issue19530] cross thread shutdown of UDP socket exhibits unexpected behavior

2013-11-15 Thread mpb
mpb added the comment: > It's just a patch to avoid returning garbage in the address. Right, which is why I pursued the point. recvfrom should not return ambiguous data (the ambiguity being between shutdown and receiving a zero length message). It is now possible to distinguish the two by lo

[issue19530] cross thread shutdown of UDP socket exhibits unexpected behavior

2013-11-15 Thread Charles-François Natali
Charles-François Natali added the comment: > mpb added the comment: > > Someone wrote a kernel patch based on my bug report. > > http://www.spinics.net/lists/netdev/msg257653.html It's just a patch to avoid returning garbage in the address. But AFAICT, recvfrom() returning 0 is enough to know th

[issue19530] cross thread shutdown of UDP socket exhibits unexpected behavior

2013-11-14 Thread mpb
mpb added the comment: Someone wrote a kernel patch based on my bug report. http://www.spinics.net/lists/netdev/msg257653.html -- ___ Python tracker ___

[issue19530] cross thread shutdown of UDP socket exhibits unexpected behavior

2013-11-11 Thread mpb
mpb added the comment: > "Connecting" a UDP socket doesn't established a duplex connection like > in TCP: Stream and duplex are orthogonal concepts. I still contend that connected UDP sockets are a duplex communication channel (under every definition of duplex I have read). The Linux connect

[issue19530] cross thread shutdown of UDP socket exhibits unexpected behavior

2013-11-10 Thread Charles-François Natali
Charles-François Natali added the comment: > After some research... > >> Which is normal, since UDP sockets aren't connected. > > But UDP sockets can be connected! > No, they can't. "Connecting" a UDP socket doesn't established a duplex connection like in TCP: it's just a shortand for not having

[issue19530] cross thread shutdown of UDP socket exhibits unexpected behavior

2013-11-09 Thread mpb
mpb added the comment: After some research... > Which is normal, since UDP sockets aren't connected. But UDP sockets can be connected! If I connect the UDP sockets, then shutdown succeeds (no exception is raised), but recvfrom still appears to succeed, returning a zero length message with a

[issue19530] cross thread shutdown of UDP socket exhibits unexpected behavior

2013-11-08 Thread Charles-François Natali
Charles-François Natali added the comment: > When I try this with a UDP socket, the thread calling shutdown > raises an OS Error (transport end point not connected). Which is normal, since UDP sockets aren't connected. > In contrast, sock.close does not cause the blocked thread to unblock. > (

[issue19530] cross thread shutdown of UDP socket exhibits unexpected behavior

2013-11-08 Thread mpb
New submission from mpb: I have a multi-threaded application. A background thread is blocked, having called recvfrom on a UDP socket. The main thread wants to cause the background thread to unblock. With TCP sockets, I can achieve this by calling: sock.shutdown (socket.SHUT_RD) When I try this w