Moved socket stuff out of server.c