alter socket server use observer pattern