Add socket management on connection