module BBS::Zmodem

ZMODEM downloads: the sending side of Chuck Forsberg’s protocol, enough for the caller’s terminal to save files from the BBS: SyncTERM, NetRunner, Qodem, lrzsz’s rz behind a plain telnet, or zmodem.js in a web terminal.

BBS::Zmodem.send_files(session, [['README.TXT', bytes, Time.now]])
# => :ok, :cancelled, :timeout or :hangup

Every control character goes out ZDLE-escaped, so the stream holds no bare CR and needs no telnet BINARY mode, and 0xFF goes out as a doubled telnet IAC (telnet: false for a plain byte pipe). While it waits for the terminal to answer, Esc or Ctrl-C gives up.