Conversation support

When a message is received on a socket connection for an input card or GET function, if an output card or PUT function in the same map specifies the same host and port number, the connection will be reused for the output card. A response message will be sent to the client that sent the request message.

The communication adapter supports conversations in several scenarios, including:

  • Input is an event - Listener detects message, GET retrieves it, and an output card sends a response to the same socket.
  • Input is not an event - GET retrieves message and an output card sends a response to the same socket.
  • =GET( ) mapping function is used. The third parameter is data to send to a socket, the resulting message is returned from the GET. In this case, the same protocol must be used both for the write and the read.

When using the communication adapter in server mode (-MODE server), the conversation between client and server can be controlled by a variety of parameters. The most important of these is the Client Connection (-CCON) command, which determines how the conversation is ended.

The default value for -CCON is exclusive (excl), which means that the connection with a client is used exclusively by an instance of a map.

This can be with the Number of Event Messages command (-NEM) to initiate a conversational map instance. The -NEM command determines how many messages need to be received to start an instance of a map. If this map instance is run in burst mode, each burst might process one or more additional message from the client, and send one or more response back to the client. In this scenario, the map instance is ended when the client disconnects from the socket.

If -CCON is set to shared (shared) then a single client connection might be used by multiple map instances concurrently. In this scenario, the -NEM command cannot be used. The number of messages processed by a single map instance is determined by the Quantity (-QTY) and Listen (-LSN) commands. The listener receives the number of messages specified by these parameters and these messages are processed by a map instance, which can send one or more response messages to the client.

If the client continues to send messages while one map instance is running, another map instance might be started. Both map instances will use the same client connection. It is the responsibility of the client to associate the request messages with any responses that might be sent from these maps. that using the -CCON (shared) command does not preclude multiple clients connecting to the socket.