Progress
External Program
Interfaces
Overview Of Tasks To Implement 4GL Sockets
Socket programming can be typically divided into three parts:
This section summarizes the tasks for programming sockets in the 4GL using the same framework. The sections that follow describe each of these tasks in more detail.
Table 10–2 lists socket programming tasks by application function, indicates whether each task is required for implementing socket communications, and provides a reference to a following section for more information on the task.
Table 10–2: Summary Of Socket Programming Tasks Application
Function
Tasks Socket Server
- Create a server socket object and enable it to listen for connections (CONNECT events) on a specified port (required). See the "Implementing a 4GL Socket Server" section.
- Define a CONNECT event procedure to respond to CONNECT events and return the socket object handle created for each connection (required). See the "Listening and Responding To Connection Requests" section.
- Make the server socket temporarily insensitive to CONNECT events. See the "Managing the Server Socket" section.
- Disable the server socket from listening for new socket connections. See the "Managing the Server Socket" section.
- Delete the server socket object. See the "Managing the Server Socket" section.
Socket Client
- Create a socket object to read and write data, and connect it to a port on a socket server (required). See the "Implementing a 4GL Socket Client" section.
Client or Server
- Define and initialize a MEMPTR variable (required to read or write data on a socket). See the "Defining and Initializing MEMPTR Variables" section.
- Test whether data is available to read on a socket. See the "Data Detection Using the Procedural Model" section.
- Define a READ-RESPONSE event procedure to respond to data coming in on a socket connection. See the "Data Detection Using the Event-driven Model" section.
- Read data on a socket and test for the number of bytes read for each read operation. See the "Reading Data On a Socket" section.
- Write data on a socket and test for the number of bytes written for each write operation. See the "Writing Data On a Socket" section.
- Marshall data into a MEMPTR buffer for writing on a socket and unmarshall data from a MEMPTR buffer after reading on a socket. See the "Marshalling and Unmarshalling Data For Socket I/O" section.
- Test whether a socket object is connected. See the "Managing Sockets and Their Connections" section.
- Make a socket temporarily insensitive to READ-RESPONSE events. See the "Managing Sockets and Their Connections" section.
- Set and get socket options. See the "Managing Sockets and Their Connections" section.
- Obtain the local and remote host IP addresses and port numbers involved in a socket connection. See the "Managing Sockets and Their Connections" section.
- Disconnect a socket object from its remote host and port. See the "Managing Sockets and Their Connections" section.
- Delete socket objects. See the "Managing Sockets and Their Connections" section.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |