I am trying to make two VICE emulators on different machines to communicate.

They are both able to write and receive characters on a specific port of the local host, but they cannot communicate as the second instance of the emulator sees the port occupied by the first, and their inputs and outputs are not cross linked.

So I am trying to put netcat in between to manage the communication and cross-link input with output.

Emulator 1 sends characters to localhost:25232 and netcat -l -p 25232 captures its output

Emulator 2 does the same on the second machine.

My problem is: How do I make netcat on both machines and have them to communicate bi-directionally between them over TCP as they were linked by a null-modem cable?

  • Hi, Can you use a cat5 cable but terminated with a serial connector ? It was a common setup when I was younger.
    – yagmoth555
    Jul 22, 2019 at 16:07

1 Answer 1



Use socat instead. Pick a different port, say 1234, and start socat on machine A listenening to this port, and also listening to 25232:

socat TCP-LISTEN:25232 TCP-LISTEN:1234

Then on machine B, connect to port 1234 on machine A:

socat TCP-LISTEN:25232 TCP:machine-b:1234

where machine-b is the DNS name or IP address.

Then start both VICE emulators.

  • Great thanks! I firstly tested it inside the same machine with socat tcp-listen:25232 tcp-listen:25231 and the tunnel worked like a charm between two program instances on the two ports 25232 and 25231! Jul 24, 2019 at 9:39
  • Between the two machines the dialogue works. Something arrives from A to B and also from B to A, too bad that the characters appear altered. Probably because I am using two 8-bit emulators (emulated c64), they use 8-bit chars and it's likely that the communication adds some bit that changes the chars meaning. I need just a way to dump the transmission and see where is the problem. Thanks a lot so far! Jul 24, 2019 at 16:13
  • socat shouldn't change anything, but maybe the emulator does. You can use socat -v (text with escapes) or socat -x (hexadecimal) to see the data transferred.
    – dirkt
    Jul 25, 2019 at 3:33
  • You were right - the garbled chars were due to the emulator and... it works! With this technique I could emulate two old vintage Commodore VIC-20 and make them net-play on the same LAN. Truly awesome!! A last tip... I noticed that at half of the net-play socat exited, how can I prevent the connection to fall? are the keywords fork/reuseaddr etc useful to make it stay stable? Jul 26, 2019 at 17:20
  • I don't know why it exited, so I don't know how to make it stable ... any error messages on exit? If the emulator is closing the connection for some reason, there's no way to make it "stable". Yes, you can use fork/reusaddr etc. to make it repeatable, if the emulator closes the connection and opens a new one. But I guess the gameplay still will interrupt in some way.
    – dirkt
    Jul 26, 2019 at 17:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .