serial: bidirectional TCP sink (mode = "tcp")#121
Conversation
|
I have regrets about using TCP: I couldn't get a working Amiga shell with nc nor with screen, probably due to mismatches between VT100-ish terminal escapes and the ANSI escapes used by the shell. Amiberry / WinUAE also relay the built-in serial to localhost:1234, which is probably a good choice for file transfers and modem emulation, but I think we should also have a pty mode that works directly with |
There was a problem hiding this comment.
Pull request overview
This PR adds a new [serial] mode = "tcp" option that bridges the emulated Paula serial port to a host TCP listener (defaulting to 127.0.0.1:1234, configurable via [serial] listen), enabling bidirectional I/O suitable for remote AmigaDOS AUX: shells and headless/scripting workflows.
Changes:
- Introduces
TcpSerialSinkimplementing a bidirectional TCP serial bridge with a background accept/read thread and a fasthas_pending_input()probe. - Extends configuration parsing/serialization to support
SerialMode::Tcpand the optional[serial] listenaddress. - Updates the launcher’s serial mode labeling/cycling to include the new TCP mode (in MIDI-feature builds).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/video/launcher.rs | Adds TCP to the launcher’s serial mode cycle/label list. |
| src/serial.rs | Implements the new bidirectional TCP serial sink and a unit test for round-tripping. |
| src/emulator.rs | Wires SerialMode::Tcp into serial sink construction using the configured/default listen address. |
| src/config.rs | Adds SerialMode::Tcp, [serial] listen, and parsing/error-message updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks for the review - all four addressed in 582d7cf:
|
|
Sorry @codewiz, just merged a bunch of things and it caused a merge conflict. Can you sort that and then I should be able to get this in. |
Bridges Paula's serial port to a host TCP listener, like UAE's TCP: serial device (same default port 1234; override with [serial] listen). With an AUX: shell on the Amiga side this gives a remote AmigaDOS console. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No problem - rebased onto current main (the conflict was just the new |
- buffered: AtomicIsize so a read that races ahead of the reader thread's fetch_add dips to a -1 debt instead of wrapping usize. - nc hint: format local_addr ip()/port() separately, IPv6-safe. - launcher: carry [serial] listen through MachineSetup so a save no longer drops the override; add a round-trip test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds a fourth [serial] mode bridging Paula's serial port to a host TCP listener, like UAE's TCP: serial device (same default port, 1234; override with
[serial] listen = "host:port").With
Mount AUX:+NewShell AUX:on the Amiga side, a connected client gets a full remote AmigaDOS console -- handy for scripted testing and for driving the emulated machine headlessly. One client at a time; a new connection replaces a finished one, and output with no client connected is dropped like an unplugged cable.Implementation notes:
has_pending_input) stays a cheap atomic load and never touches a socket.🤖 Generated with Claude Code