Skip to content

3.1r1: 9.5.3, UDP Unsolicited, and 9.5.4, unsolicited with UDP and TCP - #53

Merged
jadamcrain merged 1 commit into
mainfrom
section-9-unsolicited
Oct 14, 2026
Merged

jadamcrain merged 1 commit into
mainfrom
section-9-unsolicited

Conversation

@jadamcrain

Copy link
Copy Markdown
Member

The last part of 3.1r1's section 9, after #51 and #52: every 3.1r1 network test is now implemented.

Tests

  • 9.5.3.1 and 9.5.3.2 (Unsolicited Null 20000 / Not 20000):
    • after a restart, the null unsolicited response must come over UDP to the port set up, and not again once confirmed;
    • these tests set only where the null goes, and route everything else as the device can (to port 20000, or to the port the null was confirmed from).
  • 9.5.3.3 to 9.5.3.5 (Data Filled Messages to Port 20000 / to Originating Port / to a Fixed Port Other Than 20000):
    • every message after the null must come to the port the test expects: port 20000, the port the harness confirmed the null from, or a fixed port other than 20000 that the device also listens on;
    • that covers the master's initialization (clear IIN1.7, a poll of every input, then enable unsolicited) and an unsolicited response with events.
  • 9.5.4 (Unsolicited with Both UDP and TCP):
    • the null must come over UDP until a TCP connection is made, and over TCP only after that;
    • the events must come over TCP only;
    • a read over UDP must still be answered over UDP while the TCP connection is open.

Harness

  • A UDP socket stays bound through close(), so datagrams the device sends while it restarts still arrive.
  • After the null following a restart is read, the harness also reads any retries already waiting and confirms the newest. A manual restart can leave several queued, and an old one mustn't look like a retry sent after the confirmation.
  • connect can keep the current connection open, so the harness can use TCP and UDP at once and switch back to an earlier connection.
  • drainDatagrams counts what has arrived at a UDP socket that isn't current. In 9.5.4, datagrams that arrive while the TCP connection is being made are logged but not counted against the device.
  • The runner closes everything at the end with shutdown().
  • Waits for unsolicited events include unsolicited.holdOffMs.

Options

  • network.udp.unsolicited, which also needs supports.unsolicitedResponse;
  • network.udp.unsolicitedTo20000 and network.udp.unsolicitedToOriginatingPort (the null tests need one or the other);
  • network.udp.unsolicitedNullOtherPort, with network.udp.unsolicitedPort;
  • network.udp.fixedOtherPort;
  • network.udpAndTcp.

The configuration check requires the "other" ports to differ from 20000.

The 2.7 -describe output is unchanged.

- 9.5.3's Unsolicited Null 20000 and Unsolicited Null, Not 20000: the
  null unsolicited response after a restart comes over UDP to the port
  set up, and once confirmed, not again.
- 9.5.3's Data Filled Messages tests, to port 20000, to the port the null
  was confirmed from, and to a fixed port other than 20000 that the device
  also listens on: the master's initialization (clear IIN1.7, a poll of
  every input, enable unsolicited) and an unsolicited response with events
  all come to that port.
- 9.5.4: the null comes over UDP until a TCP connection is made, then over
  TCP only; the events too; and a read over UDP is still answered over
  UDP, with the TCP connection open.
- The driver keeps a UDP socket bound through close(), so what the device
  sends while it restarts arrives; connect can keep the current connection
  open, for TCP and UDP at once, and make it current again later;
  drainDatagrams counts what arrived at a UDP socket that isn't current.
  The runner closes everything at the end with shutdown().
- Options: network.udp.unsolicited (with supports.unsolicitedResponse),
  network.udp.unsolicitedTo20000, network.udp.unsolicitedNullOtherPort
  with network.udp.unsolicitedPort, network.udp.unsolicitedToOriginatingPort,
  network.udp.fixedOtherPort, network.udpAndTcp.

Every section 9 test is now implemented.
@jadamcrain
jadamcrain merged commit 668531f into main Oct 14, 2026
5 checks passed
@jadamcrain
jadamcrain deleted the section-9-unsolicited branch October 14, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant