tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: readv() on TCP socket returns 0

"James K. Lowden" <> wrote:
 |On Fri, 08 Mar 2013 12:21:45 +0100
 |Steffen "Daode" Nurpmeso <> wrote:
 |>|Are you saying you can't half-close a TCP connection on OS X?  I am
 |> And you're damn right, that must have been a Python bug that i've
 |> seen back in 2011, and even implemented a workaround for (after
 |> painful debugging)!
 |The OS X manual is pretty clear on the point, 
 |      "The shutdown() call causes all or part of a full-duplex
 |connection on the socket associated with socket to be shut down.  If
 |how is SHUT_RD, further receives will be disallowed.  If how is
 |SHUT_WR, further sends will be disallowed.  If how is SHUT_RDWR,
 |further sends and receives will be disallowed." 

My response comes late since this thread made me wonder wether
i've really debugged my shutdown() usage just as i'd written, or
wether i blindly trusted the Python (though Python!)
documentation.  Also because only one commit covers the shutdown

So, with Python and enabled shutdown on Mac OS X Snow Leopard
i get this:

  # recv_okline: b'+OK Welcome.'
  # send_line(shut:False): 'LIST'
  recv_into len: 29
  # recv_okline: b'+OK 0 messages (0 bytes)'
  # recv_multiline: receiving message content
  - 0 messages (0 bytes) [seen]
  # send_line(shut:True): 'QUIT'
  recv_into len: 0

So, with Python, no more +OK line can be read after a call to



With a huge snake blues,


Home | Main Index | Thread Index | Old Index