moved sockets out to own file