clean up socket server implementation