Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #53018

Re: How to check client shutdown?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail
From Grant Edwards <invalid@invalid.invalid>
Newsgroups comp.lang.python
Subject Re: How to check client shutdown?
Date Mon, 26 Aug 2013 20:24:04 +0000 (UTC)
Organization PANIX Public Access Internet and UNIX, NYC
Lines 16
Message-ID <kvgdh4$seo$1@reader1.panix.com> (permalink)
References <f543172d-85e6-467d-9fc8-f59d41381edd@googlegroups.com>
NNTP-Posting-Host dsl.comtrol.com
X-Trace reader1.panix.com 1377548644 29144 64.122.56.22 (26 Aug 2013 20:24:04 GMT)
X-Complaints-To abuse@panix.com
NNTP-Posting-Date Mon, 26 Aug 2013 20:24:04 +0000 (UTC)
User-Agent slrn/1.0.1 (Linux)
Xref csiph.com comp.lang.python:53018

Show key headers only | View raw


On 2013-08-26, Paul Pittlerson <menkomigen6@gmail.com> wrote:

> I'm currently learning about the socket module. My question is how
> can I detect if a connection is closed from the other side,

recv() will return an empty value of ''.

send() will eventually throw an exception.  [You may be able to call
send() once or twice after the connection has been closed without
getting the exception.] On Linux the exception is socket.error with
errno 32 (broken pipe).

-- 
Grant Edwards               grant.b.edwards        Yow! Is this an out-take
                                  at               from the "BRADY BUNCH"?
                              gmail.com            

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

How to check client shutdown? Paul Pittlerson <menkomigen6@gmail.com> - 2013-08-26 12:45 -0700
  Re: How to check client shutdown? Chris Angelico <rosuav@gmail.com> - 2013-08-27 06:09 +1000
    Re: How to check client shutdown? Paul Pittlerson <menkomigen6@gmail.com> - 2013-08-27 10:44 -0700
      Re: How to check client shutdown? Andrew Berg <robotsondrugs@gmail.com> - 2013-08-27 15:17 -0500
      Re: How to check client shutdown? Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2013-08-27 22:22 +0200
        Re: How to check client shutdown? Chris Angelico <rosuav@gmail.com> - 2013-08-28 06:40 +1000
          Re: How to check client shutdown? Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2013-08-27 22:49 +0200
  Re: How to check client shutdown? MRAB <python@mrabarnett.plus.com> - 2013-08-26 21:20 +0100
  Re: How to check client shutdown? Grant Edwards <invalid@invalid.invalid> - 2013-08-26 20:24 +0000

csiph-web