Use shared_ptr for EventCallback

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
Reconnect when socket is shutdown

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>