Article # 652, added by Geoworks, historical record
| first |
previous |
index |
next |
last |
How to get the IP address of my end of socket connection.
You would use the routine SocketGetMediumAddress() to get the IP address of the machine running your application. This is the address that the other end of the socket connection is using to talk to your end of the socket. Typically you would pass the following parameters to this routine: domain = "tcpip",0 buffer = a ptr to a memory chunk in the following format: SocketAddress ; (socket.h) < < port #, MANUFACTURER_ID_SOCKET_16BIT_PORT >, 6, "TCPIP", ; size "TCPIP" + null, ptr to TCHAR (nulled) 9 ; size ExtendedSACAddress + size dword > ExtendedSACAddress ; (sockmisc.h) < 3, ; size for this strucuture LT_ID, access point # ; access pointer you are using > dword buffer bufsize = size SocketAddress + size ExtendedSACAddress + size dword mau = buffer of size MediumAndUnit "result"