Progress
Language Reference


Socket Events

Progress looks for events to execute in the context of U/I blocking statements. During this processing if Progress detects that data is available on a socket or that the remote end closed its socket or it detects that a client has connected to a port that the server has enabled connections to, a socket event is generated.

There are only two socket events, READ-RESPONSE Event which applies only to socket objects and CONNECT Event which applies only to server socket objects.

READ-RESPONSE Event

Progress Detects: Data is available on a socket or the remote end of a connection has closed its socket. Applies only to socket objects.

Progress Action: Progress invokes the READ-RESPONSE event procedure.

The SET-READ-RESPONSE-PROCEDURE( ) method is used to name the READ-RESPONSE event procedure and to associate it with a socket object. Progress invokes this procedure whenever it detects that data is available on the socket or that the remote end of the socket has closed its end of the socket. In this procedure, the SELF handle identifies the affected socket object.

To determine if the event procedure was invoked because data is available for reading or because of a disconnect, the application can use one of several methods:

CONNECT Event

Progress Detects: A client has connected to a port that the server has enabled connections to. Applies only to server socket objects.

Progress Action: Progress invokes the CONNECT event procedure.

The SET-CONNECT-PROCEDURE( ) method is used to name the CONNECT event procedure and to associate it with a server socket object. The CONNECT event procedure must accept one input parameter of type HANDLE. This is the handle to the implicitly created socket object for this connection. It is via this socket object that the server communicates with the client.

If the SET-CONNECT-PROCEDURE( ) method is not invoked, or if it fails, no connection procedure will be executed when the CONNECT event occurs.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095