[Edu-sig] socket-module

Dustin James Mitchell djmitche@cs.uchicago.edu
Tue, 27 Jun 2000 12:47:01 -0500 (CDT)

On Mon, 26 Jun 2000, A[r]TA wrote:

> This is the accept method. Where can I see the lowest-level-Python-code?
> I can't see the real code from HOW it's accepting the connection.
> Is this possible and how? It's basically for me to see the TCP/IP-packages
> Python is creating....(very low level)

This is as low as the python code gets -- it's calling native C functions
somewhere, which further call the kernel to open the sockets and read and
write data.

Which is also to say that Python is not operating at the packet level --
far from it.  Python is calling C functions such as socket(), read(),
write(), and close().  All of the packet-level stuff is taken care of in
the kernel.

There are ways to peek at the packets themselves, with only a little bit
of C programming involved.  But not directly from Python.

If you're interested in this, I recommend books by the late W. Richard
Stevens.  I don't have the titles handy, but everything he's written is
excellent (and absolutely packed with every detail you need to build
networked software).  The books are not, however, for the faint of heart.


|                         Dustin Mitchell                )O(        |