Prev: Socket Error: Permission Denied (Firewall)
Next: PostgreSQL driver for Python applications that supports bytea correctly?
From: Jean-Michel Pichavant on 9 Feb 2010 13:51 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
From: Jordan Apgar on 9 Feb 2010 14:13 On Feb 9, 1:51 pm, Jean-Michel Pichavant <jeanmic...(a)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.
From: Steve Holden on 9 Feb 2010 15:39
Jordan Apgar wrote: > On Feb 9, 1:51 pm, Jean-Michel Pichavant <jeanmic...(a)sequans.com> [...] >> you swapped port & hostID in your call >> >> JM > > tThanks guys it's working now... feel a little stupid though. Cool! regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 PyCon is coming! Atlanta, Feb 2010 http://us.pycon.org/ Holden Web LLC http://www.holdenweb.com/ UPCOMING EVENTS: http://holdenweb.eventbrite.com/ |