Release 10.1A: OpenEdge Development:
Programming Interfaces

> ## Managing sockets and their connections

> To manage a socket and its connection, the 4GL allows you to:

> - Test if the socket is connected — If the `CONNECTED( )` socket method is `TRUE`, the socket is connected.

> - Control event sensitivity — At any time, you can make the socket stop receiving `READ-RESPONSE` events by setting its `SENSITIVE` attribute to `FALSE`. You can, at any time, return it to receiving `READ-RESPONSE` events by setting `SENSITIVE` to `TRUE`.

> - Set socket options — Progress supports the following options:

> - `TCP-NODELAY`
> - `SO-LINGER`
> - `SO-KEEPALIVE`
> - `SO-REUSEADDR`
> - `SO-SNDBUF`
> - `SO-RCVBUF`
> - `SO-RCVTIMEO`

> To set and get these options, use the `SET-SOCKET-OPTION( )` and `GET-SOCKET-OPTION( )` methods.

> - Obtain host and port values — You can obtain the remote host IP address and port number involved in the connection from the values of the `REMOTE-HOST` and `REMOTE-PORT` socket attributes. Similarly, you can obtain the local host and port from the `LOCAL-HOST` and `LOCAL-PORT` socket attributes.

> - Disconnect a socket — You can close the socket and remove the association between the socket object and its remote port by invoking the `DISCONNECT( )` socket method. Progress automatically closes the local socket when Progress detects that the corresponding remote socket in a connection is closed.

> - Delete the socket object — You can delete a socket object using the `DELETE OBJECT` statement. However, you must disconnect the socket before you can delete it.

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