To create a TCP server connection, do the following:
- Select New connection → Server connection on the toolbar:
- Specify the connection name.
- Choose the local COM port to be used in the connection.
- Check Create as virtual port if you want a virtual COM port to be created for this connection.Virtual ports work exactly like real ones and fully emulate their settings. Their main advantage is speed and also the fact that you can create any number of virtual ports you want and with arbitrary names.Note: a virtual COM port can have the same name as an existing real port. In this case the virtual port will “overlap” the real one, with the latter becoming inaccessible to other applications.
- Enable Strict baudrate emulation if you checked Create as virtual port and expect to send data in large blocks (2 KBs or more). This will limit the baud rate of the virtual port to the value it is actually opened with and will usually prevent potential data loss.
- In the TCP port field set the port on which you want the server to listen for client connections.Note: The TCP port you select should be allowed by your firewall and should not be already in use by another application.
- Configure the advanced settings, if needed (see the next section).
- Press Create connection.
After that, you can create a TCP client connection on a remote host.
Advanced Settings options
The advanced settings are grouped into three sections: Connection preferences, Signal lines and Security settings. The rest of this page covers them in detail.
General connection settings:
- Maximum number of simultaneous connections – can be used to restrict the maximum number of concurrent connections accepted by the server.This option is configurable only when the server is set to communicate in raw mode (see Network protocol settings below); in Telnet mode it will always be set to 1.
- Open local real port only when at least 1 incoming connection is active – is available if you create a connection on a real COM port and can be enabled to keep this port available to local applications when no remote client is connected.
- Start listening for incoming connections only when local virtual port is open – is available if the connection uses a virtual COM port. If enabled, the server will not accept any connections until the local COM port is opened by an application; otherwise, it will listen for connections even if the port is closed.
Network protocol settings:
- Use raw data transmission protocol:This mode lets you establish a raw TCP session, where all data will be transmitted as it is sent, without any protocol-specific application-layer formatting.
- Use Telnet protocol (RFC 2217):Telnet with RFC 2217 extensions gives the server and the client the facilities to exchange the COM port configuration information, with the ability to notify the remote end of any changes in the settings or the line states of the local COM port.
RFC 2217 mode was designed primarily for modems, but can also be used for serial printers, plotters, different monitoring devices as well as office equipment such as photo-copiers and cash registers.
Default port settings:
If specific port settings are expected by the device attached to your real COM port, you can set them here. (These settings can be dynamically adjusted by the remote host if the Telnet protocol is used, as mentioned above.)
Data transfer settings:
The options here will differ depending on the communication mode selected in Network protocol settings:
- In raw mode:The Receive data from and Send data to dropdowns let you configure the access permissions when communicating with multiple remote hosts at once. The available options are:
- Receive data from:
- None – no data will be accepted from any client.
- Only first / Only last – data will only be accepted from the client that is currently first / last in the list of connected clients.
- Last active – data will only be accepted from the client that sent it first; the “monopoly” will be maintained by this client as long as it is connected.
- All – data will be accepted from all clients (default).
- Send data to:
- None – no data will be sent to any client.
- Only first / Only last – data will only be sent to the client that is currently first / last in the list of connected clients.
- Last active – only the client that sent data last will be able to receive data back.
- All – data will be sent to all clients (default).
- Receive data from:
- In RFC 2217 mode:
Note: The above two options are meaningful only in configurations with a real COM port on one side and a virtual port on the other. If both ports are real, these settings will have no effect, and the changes in the port settings will not be propagated to the other end.
- Notify remote host on local port settings change – can be enabled to notify the remote host of any changes in the settings or the line states of the local COM port.
- Allow changing local port settings (real ports only) – is only available for real COM ports and, when checked, will allow the port settings be changed remotely (which requires the remote host to have the Notify remote host on local port settings change option enabled).
- Send “keep alive” every and if no reply, every – are the options controlling the keepalive timeouts. The first sets the time interval between two successive keepalive messages under normal conditions; the other – between two successive keepalive messages, if acknowledgement to the previous message was not received.The keepalive mechanism serves two basic purposes: first, it provides for detection of dead connections in a timely fashion (for instance, if the network link with a given client goes down unexpectedly), and second, it prevents automatic disconnection due to network inactivity.
- Break connection, if no activity for – check to automatically disconnect the clients with which no network activity is observed for the specified period of time.
- Add pause between packets – wait for the specified time after every network packet sent.
- Before sending data wait for – accumulate all data in a buffer for the specified time before sending it out to the network.
- Send out the data when the block is – accumulate all data in a buffer and send it only when it reaches the specified size.
- Send data when received char with code – accumulate all data in a buffer and sent it only when a character with the specified ASCII code is received.
Data buffer settings:
- Buffer size – allows to set the maximum size of the buffer used for data written to the COM port when no connection is established. The contents of the buffer will be sent to the network as soon as a connection is established. The data exceeding the size of the buffer will be discarded. Setting this option to 0 will disable buffering completely.
- Buffer small-size packets: Do not for fast response (disable Nagle algorithm) – will cause all data to be sent out to the network immediately as it appears on the COM port, without being buffered and combined into a single packet. When the data consists of very short individual messages, enabling this option allows to minimize response times at the cost of increased network traffic.
In this section you can configure the line states of the local COM port for when the connection is established and not established as well as allow or deny changing the states of certain lines when using Telnet. Different options will be available here depending on whether you are creating a connection on a real or virtual COM port and on the mode set in Network protocol settings.
If required, you can secure your connection by enabling password authorization and/or traffic encryption by checking the respective options.
If you set a password, the client will need to have it set to the same value in order to connect.