raising runtime error when socket disconnects on send