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


Groups > comp.lang.python > #44701

Re: socket programming

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.134.4.91.MISMATCH!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.040
X-Spam-Evidence '*H*': 0.92; '*S*': 0.00; 'socket': 0.07; 'stops': 0.07; 'friday,': 0.09; 'block.': 0.16; 'chris,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:programming': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'stopping': 0.24; '(or': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'message-id:@mail.gmail.com': 0.30; 'disable': 0.31; 'probably': 0.32; 'running': 0.33; 'received:209.85': 0.35; 'received:209.85.220': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'doing': 0.36; 'thanks': 0.36; 'should': 0.36; 'received:209': 0.37; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; "you're": 0.61; 'here': 0.66; 'anything.': 0.68; 'connection.': 0.74; 'effectively,': 0.84; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=dOEmrhyBSdjydHy5FyFKxBNf3bFje0fqqKAsVNpMQQE=; b=MYnzHJRVH6yVmGF65zOyCSsF70sT8+Bl3Pnvmg6eLlMHVySaUe0lJzUmVfsEIFahW5 yDKLuWSxmB5HYC1HtM1psB6cc26tX6B/1HYRU4Fn9jEIqBorTKaAaU90O7bGrXeLLZcd GWNlT6YVh8tF/JE2Z1e+lStBvywAAIN8AZaIkmS+kdCQhjjKGhSSDua93wcJMmm2mufS hAoRyHA9wr+qsLbq4Rr97eP+zvuQrId06NnqcSA2yj0xZpDQXAxDtGp5Yo9oqdKEb8Qy 4SBE0/cZHtaPsbVUnQwt5VTkQrInVxfzJOh6f13YDQ34lklOWgIWt5xsvQC1sfyzqQFQ FaDA==
MIME-Version 1.0
X-Received by 10.52.37.109 with SMTP id x13mr3899132vdj.10.1367639761677; Fri, 03 May 2013 20:56:01 -0700 (PDT)
In-Reply-To <c8534264-c126-4627-92b8-4aac056f81e3@googlegroups.com>
References <4aef55bd-f550-4a3d-b11a-285b6fa9892b@googlegroups.com> <mailman.1282.1367634220.3114.python-list@python.org> <c8534264-c126-4627-92b8-4aac056f81e3@googlegroups.com>
Date Sat, 4 May 2013 13:56:01 +1000
Subject Re: socket programming
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1283.1367639769.3114.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1367639769 news.xs4all.nl 15999 [2001:888:2000:d::a6]:55043
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:44701

Show key headers only | View raw


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

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


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