Page tree

Skip to end of metadata
Go to start of metadata

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. Choose Parasoft> Preferences.
  2. In the System Properties preferences, click Add JARs.
  3. Browse to the com.parasoft.virtualize.listener.socket-<version>.jar file and click OK.
  4. Restart Virtualize.

Command Line Installation

Add the com.parasoft.virtualize.listener.socket-<version>.jar file to the system.properties.classpath property in your localsettings 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. 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

PortDefines the port for the server. If empty, the listener will not start.
Maximum Connection BacklogDefines 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 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 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).

  • No labels