GETDSTIP
From MCS Wiki AVR
(Difference between revisions)
(Created page with "= <span class="f_Header">Action</span> = Returns the IP address of the peer. <span style="font-family: Arial;"> </span> <span style="font-family: Arial;"> </span>...") |
|||
Line 50: | Line 50: | ||
= <span class="f_Header">See also</span> = | = <span class="f_Header">See also</span> = | ||
− | [ | + | [[CONFIG TCPIP]], [[GETSOCKET]] , [[SOCKETCONNECT]], [[SOCKETSTAT]] , [[TCPWRITE]], [[TCPWRITESTR]], [[CLOSESOCKET]] , [[SOCKETLISTEN]], [[GETDSTPORT]] |
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> |
Latest revision as of 19:31, 11 February 2013
Contents |
Action
Returns the IP address of the peer.
Syntax
Result = GETDSTIP( socket)
Remarks
Result |
A LONG variable that will be assigned with the IP address of the peer or destination IP address. |
Socket |
The socket number (0-3) |
When you are in server mode, it might be desirable to detect the IP address of the connecting client.
You can use this for logging, security, etc.
The IP number MSB, is stored in the LS byte of the variable.
See also
CONFIG TCPIP, GETSOCKET , SOCKETCONNECT, SOCKETSTAT , TCPWRITE, TCPWRITESTR, CLOSESOCKET , SOCKETLISTEN, GETDSTPORT
Partial Example
Dim L as Long L = GetdstIP(i) ' store current IP number of socket i
Languages | English • Deutsch |
---|