Python - SSLSocket.recv() only returns a single byte -
I'm trying to add SSL support for my program.
Now I am going to read from that socket ...
Try: Data = sslsock .recv (4096) E: # Error except socket.error .. Why do I get only one byte? I know that more than 1 byte is available.
When I use it instead ...
data = '' while 1: try: data + = self.sock .recv (4096) Except socket.error as e: if data: brake ba: # error ... The entire string of bytes has been returned before using Wrap_socket, the entire string of bytes Always recv is returned from the call.
socket .recv actually only recv (2) recv (2) from the man page: Instead of waiting for the receipt of the full amount requested, received call Normally return any data available up to the requested amount.
Comments
Post a Comment