Add disconnect behavior for socket connection