def _read_bytes(s, count):
    """
    reads count bytes from a socket conn
    :param s: socket connection
    :param count:
    :return: byte string
    """
    rst = b''
    while True:
        tmp = s.recv(count - len(rst))
        if len(tmp) == 0:
            break
        rst += tmp
        if len(rst) == count:
            break
    return rst