[Edu-sig] Re: socket-module

A[r]TA arta@x-stream.nl
Wed, 28 Jun 2000 19:26:27 +0200

> The lowest level code is imported at the top by the statement "from
> _socket import *".  This imports a module written in C.  If you have a
> Python source distribution, you can find it at Modules/socketmodule.c.

I've been looking there, and for the socket.send-option I found this:

/* s.send(data [,flags]) method */

static PyObject *
BUILD_FUNC_DEF_2(PySocketSock_send,PySocketSockObject *,s, PyObject *,args)
 char *buf;
 int len, n, flags = 0;
 if (!PyArg_ParseTuple(args, "s#|i", &buf, &len, &flags))
  return NULL;
 n = send(s->sock_fd, buf, len, flags);
 if (n < 0)
  return PySocket_Err();
 return PyInt_FromLong((long)n);

static char send_doc[] =
"send(data[, flags])\n\
Send a data string to the socket.  For the optional flags\n\
argument, see the Unix manual.";

-----------END CUT---------------

A stupid question maybe. I want to find the parts where is described HOW a
is created. Something like:

-IP from sender
-IP from receiver

Is it possible?


 -Life can kick your ass, but all you got to do is stand up and move on...