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: 7.0   7.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3    Statistic  

Socket.LocalPort

Queries local port number.

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

MBS( "Socket.LocalPort"; SocketID )

Parameters

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

Result

Returns OK or error.

Description

Queries local port number.
This is usually 0 for a brand new socket.
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.LocalIP   -   Socket.NewTCPSocket

Feedback: Report problem or ask question.




Links
MBS Xojo Plugins