Added socket server-side  implementation