Sockets and broadcasts

Can anyone help me with using sockets in the Progress 9.1 4GL?

I need to connect to a server process on another computer. That I can do with a dll supplied by the makers of the server if I know the server address. (Socket number of server can be set). My difficulty is to locate the IP address in a DHCP environment - ie, the IP address can change from day to day.

Instructions for locating a running server go like this:

Open a UDP socket.
Broadcast this string "1" to port 52256
and each server will reply with it's location.

Obviously someone knows how to do it in some language as I have seen it work. But how?
 

Chris Kelleher

Administrator
Staff member
Wouldn't it just be possible to address the server by machine name, instead of using the IP address? This should work.
 
Chris,

Thanks for the suggestion. It works fine. I can connect to the server using a socket and read the IP address.

I could probably, if I wanted to put in lots more time do all the communication via the socket opened this way, but the software makers have generously made a "COM Object" available, and this handles all the communication very neatly. I only need use the socket to locate the IP address. No messing with Memptrs or anything.

Thanks again,

David.
 
Top