Re: Incorrect number of bytes returned by getsockopt(socket.SOL_SOCKET, socket.TCP_INFO, buflen)

2009-12-03 Thread Martien Verbruggen
On Thu, 3 Dec 2009 10:29:13 -0800 (PST), Ashwin Rao wrote: > tcp_info = sock.getsockopt(socket.SOL_SOCKET, socket.TCP_INFO, 104) In C, to get tcp_info, SOL_SOCKET should be IPPROTO_TCP. I'm assuming it's the same in Python, although I've never tried it. Martien --

Re: Incorrect number of bytes returned by getsockopt(socket.SOL_SOCKET, socket.TCP_INFO, buflen)

2009-12-03 Thread Roy Smith
In article <5c2800de-a6d2-4863-b423-87ef80d95...@k17g2000yqh.googlegroups.com>, Ashwin Rao wrote: > I computed the size of the tcp_info using the > following program, which returned 104. > --- > #include > #include > > int main() > { > printf("%d", sizeof(struct tcp_info)); > } In general

Incorrect number of bytes returned by getsockopt(socket.SOL_SOCKET, socket.TCP_INFO, buflen)

2009-12-03 Thread Ashwin Rao
Hi, I need to retrieve the tcp_info from a socket using getsockopt. The details of structure tcp_info are available at [http://src.gnu- darwin.org/src/sys/netinet/tcp.h.html]. The getsockopt method for a socket whose documentation is available at [http://docs.python.org/ library/socket.html

Re: Re: getsockopt

2005-12-16 Thread Fabian Deutsch
Steve Holden wrote: > Fabian Deutsch wrote: > >>--- Ursprüngliche Nachricht --- > >>Von: Steve Holden <[EMAIL PROTECTED]> > >>An: python-list@python.org > >>Betreff: Re: getsockopt > >>Datum: Fri, 16 Dec 2005 08:29:08 + > >> &

Re: getsockopt

2005-12-16 Thread Fabian Deutsch
Stave Holde wrote: > Fabian Deutsch wrote: > >>--- Ursprüngliche Nachricht --- > >>Von: Steve Holden <[EMAIL PROTECTED]> > >>An: python-list@python.org > >>Betreff: Re: getsockopt > >>Datum: Fri, 16 Dec 2005 08:29:08 + > >> &

Re: getsockopt

2005-12-16 Thread Steve Holden
Fabian Deutsch wrote: >>--- Ursprüngliche Nachricht --- >>Von: Steve Holden <[EMAIL PROTECTED]> >>An: python-list@python.org >>Betreff: Re: getsockopt >>Datum: Fri, 16 Dec 2005 08:29:08 + >> >>Fabian Deutsch wrote: >> >>>Hello, &

Re: getsockopt

2005-12-16 Thread Fabian Deutsch
> --- Ursprüngliche Nachricht --- > Von: Steve Holden <[EMAIL PROTECTED]> > An: python-list@python.org > Betreff: Re: getsockopt > Datum: Fri, 16 Dec 2005 08:29:08 + > > Fabian Deutsch wrote: > > Hello, > > > > my name is fabian and i'm a stu

Re: getsockopt

2005-12-16 Thread Steve Holden
Fabian Deutsch wrote: > Hello, > > my name is fabian and i'm a student from northern germany. right now i > try to create som kind of decapsulation of esp-udp packets using python. > > therefor i need to use the socket.getsockopt (SOL_IP, IP_OPTIONS, 20) > method. But al i get is some empty value

Re: getsockopt

2005-12-15 Thread Fabian Deutsch
Forgot: > The lines: > s = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP) > s.bind(('',4500)) > while 1:# Run until cancelled > message, client = s.recvfrom(1400) # <=256 byte datagram > hdr = s.getsockopt (SOL_IP, IP_OPTIONS, 20) > print "Client connected:", client > pri

getsockopt

2005-12-15 Thread Fabian Deutsch
Hello, my name is fabian and i'm a student from northern germany. right now i try to create som kind of decapsulation of esp-udp packets using python. therefor i need to use the socket.getsockopt (SOL_IP, IP_OPTIONS, 20) method. But al i get is some empty value. Nothin. Does someone know or have