Sockets and lemon curry

Ian King iking at
Sat Jun 5 16:23:20 EDT 1999

No, no, I don't know where the lemon curry fits in... with a melon?

I'm trying to implement an rshd server in Python.  The problem seems to be
with establishing the secondary socket for stderr.  I'm using a Linux 2.0
box as client, and a Windows machine as server (ultimately, this is to
support rmt access to the Windows box's tape drive).  In experimenting, I've
gotten things to work with utilities that don't require the second socket
(e.g. rcp).  But the moment I try to establish the secondary socket, the
client says, "protocol violation" and gives up.  Ideas?

In more detail, here's what I'm doing (without error handling, etc.):

s = socket(AF_INET, SOCK_STREAM)
s.bind('', 514)  # RSH well-known port
conn, addr = s.listen()    # blocks for client request
response = conn.recv(1024)    # this response has the secondary port number some string stuff to get the port number into integer type as 'port2'
s2 = socket(AF_INET, SOCK_STREAM)
s2.connect(addr[0], port2)    #addr tuple is host, port for conn

...and that's where the client says, "Pining for the fjords???" and gives
up.  I've done network tracing and can't find anything odd going on.  This
seems like a simple handshake, and if I use (for instance) the Windows
machine as a client against the Linux server (and do a network trace),
everything works and looks great.

Any ideas?  TIA - Ian

Ian King
iking at

More information about the Python-list mailing list