added rudimentay socket management