On Jun 15, 2024, at 5:50 PM, Keith Halewood <Keith.Halewood@pitbulluk.org> wrote:

Hi,
 
I think there’s a bug in in decnet/nsp.py, line 1173
A phase 3 accept is setting its state to self.cc which doesn’t seem to exist. If I change that to self.run, like the state setting for phase 2 accept, I can then send a message after accepting the connection without ‘WrongState’ being thrown.
 
This is pydecnet 1.1-648.
 
Keith

More on this: there's an assymetry in the 3-way handshake: the initiating side can start sending data as soon as it receives the accept (that data doubles as the confirm ack).  But the responding side has to wait for the connect confirm to be acknowledged before sending any data.  This asymmetry makes some sense because most applications have the initiating side sending the first data message.  But if you have an application where the responding side sends the first data message you have to wait for the ack.  The simplest way is to catch the WrongState error and retry after a brief pause.

paul