How to find the port a server-socket is listening on ?

Posted by cverbiest on 14-Mar-2019 14:59

I found that the following technique also works in OpenEdge.

define var ServerSocket as handle no-undo.

create server-socket ServerSocket.
ServerSocket:set-connect-procedure("connHandler", this-procedure).
ServerSocket:enable-connections ("-S 0").

will listen on an available port.

You can find the port using netstat but I'm looking for a way to find that port from withing the ABL code.

Is there a way to get the port from a server-socket  ?

All Replies

Posted by on 15-Mar-2019 06:42

Hi Carl, I assume windows so maybe you can try the good old winsock2 API - win32api might still be available somewhere :)  

Marian Edu

Acorn IT
+40 740 036 212

This thread is closed