network programming: how does s.accept() work?

Micah Cowan micah at cowan.name
Wed Feb 27 00:01:54 EST 2008


Grant Edwards wrote:
> On 2008-02-26, Micah Cowan <micah at cowan.name> wrote:
> 
>> 7stud, what you seem to be missing, and what I'm not sure if anyone has
>> clarified for you (I have only skimmed the thread), is that in TCP,
>> connections are uniquely identified by a /pair/ of sockets (where
>> "socket" here means an address/port tuple, not a file descriptor).
> 
> Using the word "socket" as a name for an address/port tuple is
> precisely what's causing all the confusion.  An address/port
> tuple is simply not a socket from a python/Unix/C point of
> view, and a socket is not an address/port tuple.

FWIW, the word was used to mean the address/port tuple (RFC 793) before
there was ever a python/Unix/C concept of "socket".

And I totally agree that it's confusing; but I submit that IETF has a
stronger claim over the term than Unix/C/Python, which could have just
stuck with "network descriptor" or some such. ;)

-- 
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/



More information about the Python-list mailing list