Kelly Burgess kellyb at
Mon Sep 19 20:56:19 UTC 2022

Hi Das,

>Latest Monterey on Mac with 10.2 30204
>On that platform it returns instead of like 192.168…
>It works on Windows and on Catalina Mac

TCPGetMyAddr() returns here on Catalina with Studio 10.2 31315

But if I connect a socket to something and then check using that socket, I get - my LAN address.

   TCPConnect ('',80,kFalse,kFalse) Returns socket
   TCPGetMyAddr (socket) Returns ipAddress
   TCPClose (socket,0)

The docs say:
	• It is not a mandatory requirement that a WinSock API implementation can return the local IP address, without a socket for an open connection. In this case it is likely that TCPGetMyAddr will return

	• If the local machine has more than one IP address, passing a socket eliminates ambiguity, and returns the local IP address used for the open connection.

There are additional notes re IP v4 vs v6 and Operating System and config variations:


More information about the omnisdev-en mailing list