Consultor Eletrônico



Kbase P89899: How to obtain the IP address used by the socket object
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

GOAL:

How to obtain the IP address used by the socket object

GOAL:

How to obtain the IP address of a machine communicating via socket object ?

GOAL:

How to use REMOTE-HOST socket-handle attribute

FIX:

Use the REMOTE-HOST attribute of the socket-handle in order to show the IP address of the machine the socket-object is communicating with.
The following example illustrates the use of the REMOTE-HOST attribute:
DEFINE VARIABLE SOCKET-OBJ-HDL AS HANDLE.
CREATE SOCKET SOCKET-OBJ-HDL.
SOCKET-OBJ-HDL:CONNECT("-S <port number>").
MESSAGE
SOCKET-OBJ-HDL:REMOTE-HOST
VIEW-AS ALERT-BOX INFO BUTTONS OK.
SOCKET-OBJ-HDL:DISCONNECT().
DELETE OBJECT SOCKET-OBJ-HDL.