def recvall(s, count):
  """Receive all of the data otherwise return none.

  Args:
    s: socket
    count: number of bytes

  Returns:
    data received
    None if no data is received
  """
  all_data = []
  while (count > 0):
    data = s.recv(count)
    if (len(data) == 0):
      return None
    count -= len(data)
    all_data.append(data)
  result = ''.join(all_data);
  return result