Throw exception if closed socket is writted to or read from