Move socket into protocol class.