First implementation of socket server