When the 'end' or 'close' events are emitted, we always call connectionReset(), that in turns set self.isoConnectionState = 0. Therefore, if we check for the required self.isoConnectionState of 2 before proceeding, we should avoid calling write on an already closed stream.
That was the only "unchecked" call of isoclient.write(). There may be although other points on the code where the connection gets reset by us and we don't update the self.isoConnectionState
Fix proposal for #80
When the 'end' or 'close' events are emitted, we always call
connectionReset()
, that in turns setself.isoConnectionState = 0
. Therefore, if we check for the requiredself.isoConnectionState
of2
before proceeding, we should avoid calling write on an already closed stream.That was the only "unchecked" call of
isoclient.write()
. There may be although other points on the code where the connection gets reset by us and we don't update theself.isoConnectionState