I found that the following https://stackoverflow.com/a/2675416/1817610 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 ?
Hi Carl, I assume windows so maybe you can try the good old winsock2 API - https://docs.microsoft.com/en-gb/windows/desktop/api/winsock/nf-winsock-getsockname... win32api might still be available somewhere :)