errno 107 socket.recv issue

Jordan Apgar twistedphrame at gmail.com
Tue Feb 9 20:13:46 CET 2010


On Feb 9, 1:51 pm, Jean-Michel Pichavant <jeanmic... at sequans.com>
wrote:
> Jordan Apgar wrote:
> > thanks JM,
>
> > at this point i switched over to this scheme and now I'm getting an
> > error durring instantiation of the server:
> > Server.py:
> > from Crypto.PublicKey import RSA
> > from ServerNegotiator import ServerNegotiator
> > from sharedComs import *
>
> > f = open("hostid")
> > tup = stringToTuple(f.readline()[0:-1])
> > HostID = f.readline()[0:-1]
> > f.close()
>
> > key = RSA.construct((long(tup[0]),long(tup[1]), long(tup[2]),
> > long(tup[3]),
> >                      long(tup[4]),long(tup[5])))
> > host = "localhost"
> > port = 8005
>
> > servernegotiator = ServerNegotiator(host,HostID, port, key)
> > servernegotiator.start()
>
> > ServerNegotiatior.py lines 185 - end
> > class ServerNegotiator:
> >     def __init__(self, host, port, hostid, rsa_key, buf = 512):
> >         negotiator = Negotiator(host, hostid, rsa_key,buf)
> >         self.server = SocketServer.TCPServer((host, port), negotiator)
>
> >     def start(self):
> >         self.server.serve_forever()
>
> > Traceback (most recent call last):
> >   File "Server.py", line 16, in <module>
> >     servernegotiator = ServerNegotiator(host,HostID, port, key)
> >   File "/home/twistedphrame/Desktop/communication/
> > ServerNegotiator.py", line 188, in __init__
> >     self.server = SocketServer.TCPServer((host, port), negotiator)
> >   File "/usr/lib/python2.6/SocketServer.py", line 400, in __init__
> >     self.server_bind()
> >   File "/usr/lib/python2.6/SocketServer.py", line 411, in server_bind
> >     self.socket.bind(self.server_address)
> >   File "<string>", line 1, in bind
> > TypeError: an integer is required
>
> servernegotiator = ServerNegotiator(host,HostID, port, key)
> class ServerNegotiator:
>     def __init__(self, host, port, hostid, rsa_key, buf = 512):
>
> you swapped port & hostID in your call
>
> JM

tThanks guys it's working now... feel a little stupid though.



More information about the Python-list mailing list