def read(self, size):
data = None<EOL>while True:<EOL><INDENT>try:<EOL><INDENT>data = self.handle.recv(size)<EOL><DEDENT>except socket.timeout as socket_error:<EOL><INDENT>self._reconnect(socket_error)<EOL><DEDENT>except socket.error as socket_error:<EOL><INDENT>if socket_error.errno == errno.EINTR:<EOL><INDENT>continue<EOL><DEDENT>self._reconnect(IOError)<EOL><DEDENT>if not data:<EOL><INDENT>self._reconnect(IOError)<EOL><DEDENT>break<EOL><DEDENT>return data<EOL>
Read wrapper.

Parameters
----------
size : int
  Number of bytes to read