refactor Socket classes into client/server to support TCP connections