Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : Sockets : Implementing an ABL socket server
 

Implementing an ABL socket server

This section describes how to implement an ABL socket server.
To implement a socket server:
1. Create a server socket object using the CREATE SERVER-SOCKET statement.
2. Enable the server socket to listen for connections using the ENABLE-CONNECTIONS( ) method. This assigns the socket to a specified TCP/IP port on which ABL listens and accepts connection requests.
Note: ENABLE-CONNECTIONS() also lets you set the length of the pending-connection queue. For more information, see the reference entry for the ENABLE-CONNECTION() method in OpenEdge Development: ABL Reference.
3. Specify a CONNECT event procedure using the SET-CONNECT-PROCEDURE( ) method.
4. Wait for CONNECT events using an input-blocking statement or poll for CONNECT events using the PROCESS EVENTS statement.
Once you have a connection established from a client, you can read data from and write data to the client on the connection. You can also manage the server socket that you have enabled for listening.
The sections that follow describe these steps in more detail.
* Listening and responding to connection requests
* Managing the server socket