Fix send message if socket is close.