Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #44702
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2013-05-03 21:03 -0700 |
| References | <4aef55bd-f550-4a3d-b11a-285b6fa9892b@googlegroups.com> <mailman.1282.1367634220.3114.python-list@python.org> <c8534264-c126-4627-92b8-4aac056f81e3@googlegroups.com> <mailman.1283.1367639769.3114.python-list@python.org> |
| Message-ID | <21c9450f-1da9-4acd-8f23-d90f71758bfb@googlegroups.com> (permalink) |
| Subject | Re: socket programming |
| From | Pedro <pedro@ncf.ca> |
On Friday, May 3, 2013 11:56:01 PM UTC-4, Chris Angelico wrote: > On Sat, May 4, 2013 at 1:37 PM, Pedro <pedro@ncf.ca> wrote: > > > On Friday, May 3, 2013 10:23:38 PM UTC-4, Chris Angelico wrote: > > >> The accept() call should block. It's not going to spin or anything. If > > >> > > >> you need to monitor multiple sockets, have a look at select(). > > > > > > Thanks Chris, can you elaborate on the accept() call should block? > > > > When you call accept(), your program stops running until there's a > > connection. It's like calling input() (or raw_input()) and your > > program stopping until you type something. You can disable that by > > setting the socket nonblocking, but I don't think you're doing that > > here (and you probably don't want to). > > > > Consider the accept() call to be, effectively, like reading from the > > bound socket. In many ways it functions that way. > > > > ChrisA Brilliant explanation Chris, I swear I read three different docs on that question and could not deduce what you just wrote. Thank you.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
socket programming Pedro <pedro@ncf.ca> - 2013-05-03 19:13 -0700
Re: socket programming Chris Angelico <rosuav@gmail.com> - 2013-05-04 12:23 +1000
Re: socket programming Pedro <pedro@ncf.ca> - 2013-05-03 20:37 -0700
Re: socket programming Chris Angelico <rosuav@gmail.com> - 2013-05-04 13:56 +1000
Re: socket programming Pedro <pedro@ncf.ca> - 2013-05-03 21:03 -0700
Re: socket programming Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2013-05-04 11:37 +0200
Re: socket programming Chris Angelico <rosuav@gmail.com> - 2013-05-04 20:00 +1000
Re: socket programming Pedro <pedro@ncf.ca> - 2013-05-06 08:54 -0700
Re: socket programming Chris Angelico <rosuav@gmail.com> - 2013-05-07 02:05 +1000
Re: socket programming Arnaud Delobelle <arnodel@gmail.com> - 2013-05-06 19:54 +0100
csiph-web