[Python-Dev] The socket HOWTO
eliben at gmail.com
Tue Jun 7 19:37:44 CEST 2011
> Yes, these are all excellent concepts to be familiar with. But the word
> "socket" (and the socket HOWTO) refers to a specific way to interface with
> those concepts, the Berkeley socket API:
> <http://en.wikipedia.org/wiki/Berkeley_sockets>. Which you don't have to
> know anything about if you're going to use Twisted. You should know about
> IPC in general, and TCP/UDP specifically if you're going to use Twisted, but
> sockets are completely optional.
> Also, I feel that I should point out that the sockets HOWTO does not cover
> even a single one of these concepts in any useful depth. If you think that
> these are what it should be explaining, it needs some heavy editing. Here's
> what it has to say about each one:
> what is a TCP connection?
> The only place that the characters "TCP" appear in the entire document is in
> the phrase "... which is completely different from TCP_NODELAY ...".
> Nowhere is a TCP connection explained at a conceptual level, except to say
> that it's something a web browser does.
> how is UDP different from TCP?
> The phrase "UDP" never appears in the HOWTO. DGRAM sockets get a brief
> mention as "anything else" in the sentence: "... you’ll get better behavior
> and performance from a STREAM socket than anything else ...". (To be fair,
> I do endorse teaching that "the difference between TCP and UDP is that you
> should not use UDP" to anyone not sufficiently advanced to read the relevant
> reference documentation themselves.)
> when data arrives, what layers of software does it go through?
> There's no discussion of this that I can find at all.
> what is a port number?
> Aside from a few comments in the code examples, the only discussion of port
> numbers is "low number ports are usually reserved for “well known” services
> (HTTP, SNMP etc)."
> It would be very good to have a "Python networking overview" somewhere that
> explained this stuff at a very high level, and described how data might get
> into or out of your program, with links to things like the socket HOWTO that
> describe more specific techniques. This would be useful because most
Just be careful not to reproduce http://www.apress.com/9781590593714 :-)
These things tend to get out of hand very quickly.
More information about the Python-Dev