Skip to main content

Socket IO Client

Socket IO is a powerful library that facilitates real-time, bidirectional communication between web clients and servers. This guide explains how to configure and use the SocketIO client within a chat interface in an application, specifically focusing on setting up real-time communication for sending and receiving messages using a text box and buttons.

The Socket IO Client is typically used in scenarios such as:

  • Real-time dashboards and analytics
  • Chat or messaging applications
  • Notifications and alerts

How it Works:

  • Socket Connection: Establishes a persistent connection to a Socket.IO server using the Connect to Socket IO/Websockets server.
  • Events: Use Send and Receive events to send and receive custom messages between client and server. These can be predefined or dynamic.
  • Emit: Client sends an event to the server. Messages can be sent using the Send Message Using Socket IO/Websockets construct.
  • On/Listen: Receive Events listens for events emitted by the server.

Adding and Configuring the Socket IO Client​

  1. In the Explorer menu of your application, locate the Socket IO Client folder.
  2. Right-click on the folder and select Add.
  3. Upon adding the new client, two folders are created by default - Receive Events and Send Events.
  4. In the Properties pane that appears, fill in the following details:
PropertyDescription
NameName of the Socket IO Client.
URLThe Socket IO server URL (e.g., https://your-server-domain.com, ws://your-server-domain.com).
Is ActiveIndicates whether the Socket.IO client is enabled or disabled.
DescriptionSummary of the Socket.IO client configuration.

Configure Receive and Send Events​

Receive Events Configuration​

  1. Navigate to the Receive Events folder.
  2. Right-click and select Add Event and configure the following properties.
PropertyDescription
NameName of the event.
Event NameName of the event to listen for (e.g., getMessage).
Async OperationExecutes independently without waiting for completion (Default: Yes).
Is ActiveIndicates whether the event is active or inactive. By Default, 'Yes' is selected.
DescriptionSummary of the event.

The created Receive Event contains:

  • Output Parameters
  • Variables

Adding Output Parameters and Variables​

Users can add Output Parameters and Variables to an event as applicable.

Steps:

  1. Right-click on Output Param or Variables and select Add. A pop-up window appears.
  2. Configure the required properties and click Save.
PropertyDescriptionComments
Parameter Name*Name of the parameter.Must start with a letter, followed by alphanumeric characters or '_'. No spaces or special characters (except '_'). Cannot start with a number.
Is ArraySpecify whether the parameter is an array or not.Default: No.
Data Type*Select the data type from the drop-down.String, Integer, Long, Double, Boolean, DateTime, Any, Map, and Entities.
Default ValueSpecify the default value if required.-
DescriptionProvide a brief summary describing the purpose of the parameter or variable.-

Note: An asterisk (*) denotes a mandatory property for creating a parameter or variable.

A success message will display upon successfully adding a parameter or variable.

  1. Navigate to the Send Events folder.
  2. Right-click and select Add Event and configure the following properties.
PropertyDescription
NameName of the event.
Event NameName of the event to emit.
Async OperationExecutes independently without waiting for completion (Default: Yes).
Is ActiveIndicates whether the event is active or inactive.
DescriptionSummary of the event.

The created Send Event contains:

  • Input Parameters
  • Variables

Adding Input Parameters and Variables​

Users can add Input Parameters and Variables to an event as applicable.

Steps:

  1. Right-click on Input Param or Variables and select Add. A pop-up window appears.
  2. Configure the required properties and click Save.
PropertyDescriptionComments
Parameter Name*Name of the parameter.Must start with a letter, followed by alphanumeric characters or '_'. No spaces or special characters (except '_'). Cannot start with a number.
Is ArraySpecify whether the parameter is an array.Default: No.
Data Type*Select the data type from the drop-down.String, Integer, Long, Double, Boolean, DateTime, Any, Map, and Entities.
DescriptionProvide a brief summary describing the purpose of the input parameter or variable.-

Note: An asterisk (*) denotes a mandatory property for creating a parameter or variable.

A success message will display upon successfully adding a parameter or variable.