code: def read(self, length):
          
          data = bytearray()
          while len(data) != length:
              data += self.sock.recv((length - len(data)))
              if not data:
                  raise ConnectionError('Connection unexpectedly closed.')
          return data
docs: Read as many bytes from socket as specified in length.
          Loop as long as every byte is read unless exception is raised.