wolfssh/examples/client
John Safranek 48bcd39c13 examples: half close and drain at shutdown
The client and the echoserver both sent their shutdown messages and then
spun wolfSSH_worker() a fixed number of times, so whether the peer's
close was seen at all depended on timing. Both now half close the
socket and read until the peer hangs up; the client sends a disconnect
first, the echoserver does not.

- test.h adds WSHUTDOWN(), a write-side shutdown() on POSIX and Windows,
  left undefined where the stack has no half close.
- test.h adds HalfCloseAndDrain(). It flushes a queued write, then reads
  the raw socket, since the library reads nothing after the session
  ends, and gives up ten seconds in or after 256 reads. MQX gets a stub.
- SendDisconnectAndDrain() sends MSG_DISCONNECT for up to ten seconds,
  then drains. It returns WS_WANT_READ for a peer that never hung up,
  WS_WANT_WRITE for a disconnect still queued, WS_SUCCESS for a reset.
- test.h adds WaitForChannelClose(), which runs the session until the
  peer's channel close, bounded at ten seconds, and returns at once on a
  session an error already ended. MQX gets one pass.
- client.c waits for the close, keeping a late exit status, and reports
  an unexpected shutdown result. It exits 0 on either give-up and fails
  on a broken wait or a disconnect it could not send.
- echoserver.c replaces its 10-attempt worker loop with the drain alone:
  the close exchange ended the session, and OpenSSH's client exits 255
  on a disconnect that lands before it is done.
2026-10-13 10:45:39 -05:00
..
client.c examples: half close and drain at shutdown 2026-10-13 10:45:39 -05:00
client.h Release v1.4.22 2025-12-29 16:53:33 -08:00
common.c examples, keys: add an Ed25519 user credential 2026-09-17 23:27:22 +02:00
common.h fix for flags handling, ocsp case, macro guards, unused variable, changed default from MY to required to be set 2026-09-05 01:32:02 -07:00
include.am refactor client apps and add X509 to scpclient 2023-04-04 14:59:46 -07:00