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


Groups > comp.lang.python > #4003

Re: sockets: bind to external interface

References <k4vg88-0tt.ln1@svn.schaathun.net> <mailman.815.1303760950.9059.python-list@python.org> <ra1h88-e0u.ln1@svn.schaathun.net> <mailman.816.1303763462.9059.python-list@python.org> <ip4oed$gcc$2@r03.glglgl.eu>
Date 2011-04-26 07:50 +1000
Subject Re: sockets: bind to external interface
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.820.1303768243.9059.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Apr 26, 2011 at 7:18 AM, Thomas Rachel
<nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de>
wrote:
> Am 25.04.2011 22:30, schrieb Chris Angelico:
>
>> If you don't care what port you use, you don't need to bind at all.
>> That may be why it's not mentioned - the classic TCP socket server
>> involves bind/listen/accept, and the classic TCP client has just
>> connect; bind/connect is a lot less common.
>
> That is right, but I cannot see where he mentions the "direction" of the
> socket. My fist thought was that he tries to have a server socket...
>
> (BTW: bind can be omitted on server sockets as well; listen() seems to
> includes a bind(('', 0)) if not called explicitly before. In this case, the
> port is assigned randomly. Can be useful in some cases, where the port
> number is not fixed...)

Yes; for FTP data sockets, it doesn't matter what the port is, as long
as you tell the other end. Same as you can bind/connect, you can
not-bind and listen/accept. This is why I'm glad the socket subsystem
allows unusual behaviours (I've used bind/connect in a few places).
Give the programmer the tools and let him do what he chooses!

Chris Angelico

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


Thread

sockets: bind to external interface Hans Georg Schaathun <hg@schaathun.net> - 2011-04-25 20:37 +0100
  Re: sockets: bind to external interface Chris Angelico <rosuav@gmail.com> - 2011-04-26 05:49 +1000
    Re: sockets: bind to external interface Jean-Paul Calderone <calderone.jeanpaul@gmail.com> - 2011-04-25 13:13 -0700
    Re: sockets: bind to external interface Hans Georg Schaathun <hg@schaathun.net> - 2011-04-25 21:14 +0100
      Re: sockets: bind to external interface Hans Georg Schaathun <hg@schaathun.net> - 2011-04-25 21:24 +0100
        Re: sockets: bind to external interface Chris Angelico <rosuav@gmail.com> - 2011-04-26 07:21 +1000
      Re: sockets: bind to external interface Chris Angelico <rosuav@gmail.com> - 2011-04-26 06:30 +1000
        Re: sockets: bind to external interface Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-04-25 23:18 +0200
          Re: sockets: bind to external interface Chris Angelico <rosuav@gmail.com> - 2011-04-26 07:50 +1000
          Re: sockets: bind to external interface Hans Georg Schaathun <hg@schaathun.net> - 2011-04-26 06:20 +0100
      Re: sockets: bind to external interface Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-04-25 23:14 +0200
  Re: sockets: bind to external interface Jean-Michel Pichavant <jeanmichel@sequans.com> - 2011-04-26 11:24 +0200

csiph-web