com2tcp is the oldest network tool in the com0com project: a COM port to TCP redirector that lets a serial application talk across a network — to a TCP/IP host, or to a real serial port attached to another computer — as easily as if the port were local. If you have found old download pages and forum posts recommending it, this guide explains what com2tcp was, what became of it, and how you actually use it today. The short version: you do not download com2tcp any more. It ships inside hub4com, and understanding why will save you from running a 2007 binary on a modern network.
The honest history: 1.3.0.0 was the last standalone release
com2tcp’s standalone releases ended at version 1.3.0.0 in 2007. Two years later, hub4com 2.0.0.0 (March 2009) records in its own changelog: “Implemented all com2tcp functionality.” From that release on, the redirector lived inside the hub, and the hub4com ReadMe describes the modern arrangement precisely:
“com2tcp.bat is a wrapper to hub4com.exe. It works very similar to the ‘COM port to TCP redirector’ (com2tcp). It supports all com2tcp’s options.” The batch file in hub4com’s examples folder translates a classic com2tcp-style command line into the equivalent hub4com invocation, filters and all. Same project, same author (Vyacheslav Frolov), same options — maintained as part of the hub package (hub4com 2.1.0.0, 2012) rather than as a separate fossil.
What a redirector actually does
A redirector is a bridge with a serial end and a network end. Data arriving at the COM port is sent out over a TCP connection; data arriving from the network is delivered to the COM port. An application that only knows how to open COM2 can thereby talk to a service on another continent, or a device attached to a PC in another building, without knowing networks exist. The ReadMe’s example is deliberately retro — an MS-DOS terminal program from Norton Commander, TERM95.EXE, used to reach a telnet server — because that is the enduring use case: old software, new networks.
The ReadMe recipe: an old terminal program meets telnet
- Create a virtual pair whose friendly end the application will open. The ReadMe creates COM2 paired with CNCB0:
command> install 0 PortName=COM2 -(the setupc reference explains the syntax). - Start the redirector on the pair’s inner end, pointed at the telnet server — exactly as the ReadMe gives it:
com2tcp --telnet \\.\CNCB0 your.telnet.server telnet
- Start the application on COM2. Everything it sends travels through the pair, through com2tcp’s wrapper, and out to the server; replies make the same trip back.
The --telnet option in that command is one of the options the batch file’s own usage text documents: “use Telnet protocol.” Its sibling --terminal <type> selects a terminal type (RFC 1091). Without --telnet, the bridge is a plain raw TCP connection — which is what most device and server work actually wants.
Client mode and server mode
com2tcp.bat’s built-in usage (run it with --help) defines the two shapes the bridge can take:
- Client mode:
com2tcp [options] \\.\<com port> <host addr> <host port>— the redirector initiates the TCP connection to a listening host. This is the telnet example above, and the shape you use when the far end is a server. - Server mode:
com2tcp [options] \\.\<com port> <listen port>— the redirector listens on a local TCP port and bridges whoever connects to the COM port. This is how you publish a local serial device to the network in its simplest form.
The same usage text lists the line settings the wrapper accepts — --baud (default 19200), --data (default 8), --parity (default no) and --stop (default 1), each also accepting a “default” value meaning “use the port’s current settings” — plus two behavioural options worth knowing: --ignore-dsr, which stops the wrapper waiting for the DSR signal before connecting, and --connect-dtr, which ties the DTR signal to the connection state. On the client side, --awak-seq can hold the connection until a chosen wake-up sequence arrives from the port, and both modes accept --interface to choose which network interface the wrapper connects from or listens on — the sort of detail that matters on machines with both a wired and a wireless adapter. The full list is one command away: the batch file prints its complete usage, options and defaults whenever you run it with --help, and that built-in text — not a forum post — is the authority for what your copy accepts.
Under the hood of the wrapper
It is worth knowing what the batch file actually does with your command line, because it explains the options above. com2tcp.bat does not contain a redirector; it assembles a hub4com command. Reading the script, it always adds a trace filter, and by default it adds a pin2con filter — a filter that ties the network connection to the port’s DSR signal, so the connection is made when the serial side signals readiness and dropped when that signal goes away. That is why --ignore-dsr exists: it removes the pin2con behaviour and makes the connection permanent for devices that never raise DSR. The wrapper also sets an automatic reconnect interval for the connection. None of this needs configuring for the standard recipes, but when a bridge connects and disconnects in a rhythm you did not expect, the DSR behaviour is the first place to look — and --ignore-dsr is the documented switch for it.
com2tcp.bat or full hub4com?
Use com2tcp.bat when the job is one port to one network endpoint, in either direction. It is the redirector, with the redirector’s options, and nothing else to configure. Use hub4com directly when the job stops being a single bridge:
- More than two endpoints — one port feeding several applications or several ports (the hub guide and the GPS sharing recipe).
- You need the stream modified on the way through — filters for modem pins, tracing, telnet handling.
- You need RFC 2217, the protocol that carries serial settings and signals over the network properly. The ReadMe itself gives this advice: if com2tcp is what you need but you cannot find some required functionality — “for example RFC 2217 support” — “then try use hub4com instead.” In practice that means the sibling wrapper, covered in our RFC 2217 server and client guide.
Getting it, and what to avoid
com2tcp.bat is in the examples folder of the hub4com 2.1.0.0 package — get it from the hub4com hub page, which publishes the package’s verified SHA-256 checksum, alongside the driver downloads on the download page. The wrapper expects hub4com.exe to be findable (it adds its own folder to the path), so keep the batch files and the executable together as the package ships them.
What to avoid: standalone “com2tcp” downloads from third-party software sites. At best they are the unmaintained 2007 binary, frozen before hub4com absorbed the functionality; at worst they are repackaged by people whose business is bundling. The project’s own distribution has everything those pages pretend to offer, in its maintained form. If your bridge misbehaves once running — a real port that receives nothing, a connection that drops — the hub’s own FAQ item on CTS handshaking (--octs=off) and the troubleshooting hub are the places to look next.
