Use shared_ptr for connection buffer.