M2Crypto problem

李 曉玲 hllee678 at hotmail.com
Mon Apr 21 08:11:53 EDT 2003


Hi,
I am using M2Crypto to write the SSL server and client.
My server was based on Medusa.
The client built a SSL connection to server,
and then created a new thread to receive the response from server.

The code of client:
rfile=sock.makefile('rb',-1) #sock is the ssl connection between server and 
client
try: 
   data = rfile.read(100)
   if not data:
      print "no data, maybe try to close connection"   
except:
   print "exception, maybe try to close connection"   

When the server shutdown and close the SSL connection between server and 
client,
the client receiving thread raised a windows exception on rfile.read 
procedure:
Unhandled exception in python.exe (PYTHON21.DLL): 0xC0000005: Access 
Violation

The code of server:
sock.shutdown(2)         # socket is the ssl connection between server and 
client
sock.close() 

Please help me if you know how to solve this problem.
Thank you very much!


_________________________________________________________________
現在就上 MSN 台灣網站:與親朋好友緊密聯繫,即時掌握新聞、財經、娛樂的最新訊
息 http://msn.com.tw 






More information about the Python-list mailing list