Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old


Queries local IP.

Component Version macOS Windows Linux Server iOS SDK
Socket 8.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Socket.LocalIP"; SocketID )   More


Parameter Description Example
SocketID The socket ID received by Socket.Connect function. $sock


Returns text or error.


Queries local IP.
This is usually for a brand new socket.
Can return IPv4 or IPv6 address.
Does not work on Windows 7 or older (requires Vista on Windows).


Get local port and IP:

Set Variable [ $sock ; Value: MBS("Socket.Connect"; ""; 80) ]
Set Variable [ $$LocalPort ; Value: MBS( "Socket.LocalPort"; $sock ) ]
Set Variable [ $$LocalIP ; Value: MBS( "Socket.LocalIP"; $sock ) ]
Set Variable [ $r ; Value: MBS("Socket.Close"; $sock) ]

See also

Release notes

Blog Entries

This function checks for a license.

Created 28th December 2017, last changed 4th March 2023

Socket.Listen - Socket.LocalPort