errno 107 socket.recv issue

Jean-Michel Pichavant jeanmichel at sequans.com
Tue Feb 9 13:51:31 EST 2010


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




More information about the Python-list mailing list