[Tutor] Figuring out a protocol for fun and education

"Jörg Wölke" lumbricus at gmx.net
Fri Jan 23 18:00:29 EST 2004


> Hello there, 

Hallo!

[ snip ]

> import socket
> 
> socket.setdefaulttimeout(30)
> 
> HOST = '192.168.1.20'
> SOCKET = 3185
> 
> sockobj = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> sockobj.connect((HOST, SOCKET))
> 
> while True:
>     message = raw_input('Message: ')
>     if message == 'quit':
>         break
>     sockobj.send(message)
>     data = sockobj.recv(1024)
>     print 'Got ', data
> 
> sockobj.close()
> ===================================
> (Note this is Python 2.3). The first time I send something -- anything --
> I 
> get "SuSE Meta pppd (smpppd), Version 1.00" as a response, which proves
> that 
> I'm reaching the right socket etc. However, anything after that is met
> with 
> silence until the time out is reached.

Is there a line terminator at the end of the message you send ("\015\012")?
Perhaps you need to flush the output filedescriptor after sending?
 
> Since this is getting frustrating, I'm wondering about creating a
> transparent 
> proxy instead, that I would do nothing more than pass along the stuff it 
> receives from cinternet to smpppd and vice versa while printing out a log
> of 
> what it is doing. Haven't gotten around to coding it yet, though.
> 
> This can't be a new problem, and I wonder if there is a standard way of 
> approaching it that I am simply not aware of and somebody could point me
> to 
> before I get too frustrated and just read the code.

man tcpdump

[ snip ]

> Thank you for any pointers,
> Y, Scot

HTH und Gruss, J"o!

-- 
Sie dürfen diesen Satz zitieren.

+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail




More information about the Tutor mailing list