...
Configuration attributes in the SocketAdapter Configuration Property Sheet (CPS) with Expert Properties enabled are explained below.
Figure 1: SocketAdapter Configuration CPS
...
Tip |
---|
Refer Error Handling section in Common Configurations for detailed information. |
CreateSocket?
Enable - Acts as a server by creating a socket on the specified port and listens to client connections
Note Enabling this property
- disables the properties Connection Idle Timeout and Is Synchronous? too.
- makes the Block Clients following properties property available for configuration.:
Disable - Acts as a client assuming that the server is already running on the specified port and connects to it.
...
Note | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
|
Anchor | ||||
---|---|---|---|---|
|
When the Close idle connections check box is enabled, it acts as a server and closes inactive client connections based on the idle time which can be set for a session of connection specified in milliseconds.
Note |
---|
It is displayed only when the Create Socket option is enabled. |
Idle time (ms)
Idle time is the maximum time interval for the client to not to send a request to the server. If the time taken to send the request from the client is more than the idle time, the session is closed. A new session gets created only when the client is sending another request.
Note |
---|
If the value is zero, it waits infinitely for the session to be idle. |
Figure 11: Attributes to specify the Idle time
Functional Demonstration
The following Sample flow has two socket microservices, one acting as the server and the other as client. After receiving requests from the client, the server will send it to the SMTP component connected to its output port, and then the response from the SMTP component is, in turn, sent back to the client.
Figure 1112: Sample Event Process
Scenario 1: Decode Type as 'Delimiter'
'SampleServer' Component Configuration is shown in the following figure.
Figure 1213: Socket Adapter Configuration in Server mode
'SampleClient' Component Configuration is shown in the following figure.
Figure 1314: Socket Adapter Configuration in Client mode
...
'SampleServer' Component Configuration is shown in the following figure.
Figure 1415: Socket Adapter Configuration in Server mode
'SampleClient' Component Configuration is shown in the following figure.
Figure 1516: Socket Adapter Configuration in Client mode
...
The following Sample flow has one socket adapter acting as client. After receiving requests from the client, the configured WSSStub (as Server) sends the response back to the client. In the client configuration, SuspendTimeout is 10 sec. If the client fails to receive response within the configured suspendtimeout (10 sec), then the next request message sent by client will be processed and a timeout error message is sent to the Error port of the client.
Figure 1617: Sample Event Process
Figure 1718: Socket Adapter Configuration in Client mode for Synchronous Communication
Figure 1819: Sample Request
Figure 1920: Sample Response
Info |
---|
Is Synchronous? option can be used with any Decode Type (Delimiter/ Length/None). |
...