changed the way socket.read handles incoming data (avoid socket polling)