From: Ajay <abr...@ma...> - 2004-10-04 01:28:22
|
hi! i have a client and server that communicate over an SSL connection. the client connects to the server and sends some data and then closes. For some reason, on the server side, every time i try to read data, i ger a ZeroReturnError. my client code is s =3D socket.socket(socket.AF_INET, socket.SOCK_STREAM) conn =3D SSL.Connection(ctx, s) conn.connect((host, port)) conn.send(result) conn.shutdown() conn.close() the server is addr =3D (SERVICE_HOST, SERVICE_PORT) globals()['serverconn'] =3D Connection(context, socket.socket(socket.AF_I= NET, socket.SOCK_STREAM)) globals()['serverconn'].bind(addr) print "server started" globals()['serverconn'].listen(5) while 1: (cli, address) =3D globals()['serverconn'].accept() print 'Connection from %s' % (addr,) #try: str =3D cli.recv(1024) data=3D"" while len(str) !=3D 0: data +=3D str str =3D cli.recv(1024) print "received " #, data the error comes at "str =3D cli.recv(1024)" i get to the 'the connection from...' print statement, and then the error comes up. What am i doing wrong? And how can i get rid of the error? the same code worked fine before i added the SSL part, so i doubt there i= s anything fundamentally wrong with the code. thanks cheers ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. |