In this section:
Introduction
The TCP/IP Socket Listener is a custom message listener extension for Parasoft Virtualize. It opens a TCP/IP socket and listens for incoming messages (with a configurable encoding and EOF token), then forwards each message to Virtualize, which processes it, then returns the virtualized response.
Installation
You can install this extension from the UI or the command line.
UI installation
- Choose Parasoft> Preferences.
- In the System Properties preferences, click Add JARs.
- Browse to the com.parasoft.virtualize.listener.socket-<version>.jar file and click OK.
- Restart Virtualize.
Command Line Installation
Add the com.parasoft.virtualize.listener.socket-<version>.jar file to the system.properties.classpath property in your settings properties file. For example:
system.properties.classpath=<path to jar>/com.parasoft.virtualize.listener.socket-1.1.1.jar
Usage
Once installed, you can select and configure the listener in the Virtual Asset configuration panel.
- Open the Virtualize Server view and choose a virtual asset.
- Navigate to Transports> Custom in the Virtual Asset Deployment Settings to access the socket listener.
If multiple listeners are installed, choose com.parasoft.virtualize.listener.socket.SocketListener from the Select Implementation drop-down menu.
Configuration
You can configure the following settings.
Connection Settings
Port | Defines the port for the server. If empty, the listener will not start. |
---|---|
Maximum Connection Backlog | Defines the maximum amount of connections to maintain in the backlog. If the worker threads are busy the backlog will begin to fill as the connections wait for a turn to be worked on, if the backlog fills up then subsequent connections will be refused by the listener. |
Idle Sleep | Defines time to sleep, in milliseconds, when there are no pending connections to accept, this avoids CPU time being taken by a busy loop. |
Workers Settings
Character Encoding | Defines the character encoding of the incoming messages. If empty, the default value (UTF-8) will be used. |
---|---|
EOF Token | Defines the message delimiting character(s) used to determine the end of a message. The incoming message is generated by buffering the request input until either the EOF Token is read or the end of the input stream is reached. The EOF Token is always appended to outgoing messages. If empty, the default value will be used. The default value is the End Transmission Block (ETB) character (non-visible). Other non-visible characters can be defined using their character code. For instance, if you wanted to define the ETB character manually, you could enter |
Maximum Workers | Defines the maximum amount of concurrent connections that can be worked on at any given time. If a large number of concurrent connections are required, the value can be increased. However, increasing the value could impact performance. Large values should only be used on powerful machines. If empty, the default value (50) will be used. If the value is zero (0), then an unlimited amount of workers can be created (not recommended). |