use sock.sendall instead of sock.send to fix Ubuntu restart-hang issue