Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.5   7.0   7.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2    Statistic  

Socket.LocalIP

Queries local IP.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Socket 8.0 Yes Yes Yes Yes Yes

MBS( "Socket.LocalIP"; SocketID )

Parameters

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

Result

Returns OK or error.

Description

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

Examples

Get local port and IP:

Set Variable [ $sock ; Value: MBS("Socket.Connect"; "monkeybreadsoftware.de"; 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


Socket.Listen   -   Socket.LocalPort

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins