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

  1. Go to Parasoft > Preferences and click System Properties.
  2. Click Add JARs and choose com.parasoft.virtualize.listener.socket-<VERSION>.jar.
  3. Click Apply.
  4. 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.

  1. Open the Virtualize Server view and choose a virtual asset.
  2. Click the Transports > Custom tab 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 menu.

Configuration

You can configure the following settings.

Connection Settings

PortDefines the port for the server. If empty, the listener will not start.
Maximum Connection BacklogDefines the maximum number 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 SleepDefines 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 EncodingDefines 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 \u0017 into this field.

Maximum Workers

Defines the maximum number 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 number of workers can be created (not recommended).

  • No labels