forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhostAddress.xml
More file actions
50 lines (50 loc) · 3.42 KB
/
Copy pathhostAddress.xml
File metadata and controls
50 lines (50 loc) · 3.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<doc>
<legacy_id>1473</legacy_id>
<name>hostAddress</name>
<type>function</type>
<syntax>
<example>the hostAddress of <i>host</i>:<i>port</i>[|<i>connectionID</i>]</example>
<example>hostAddress(<i>host</i>:<i>port</i>[|<i>connectionID</i>])</example>
</syntax>
<library></library>
<objects>
</objects>
<synonyms>
</synonyms>
<classification>
<category>Networks & Communication</category>
</classification>
<references>
<command tag="accept">accept Command</command>
<function tag="peerAddress">peerAddress Function</function>
<function tag="hostAddressToName">hostAddressToName Function</function>
<function tag="DNSServers">DNSServers Function</function>
</references>
<history>
<introduced version="1.0">Added.</introduced>
</history>
<platforms>
<mac/>
<windows/>
<linux/>
<ios/>
<android/>
</platforms>
<classes>
<desktop/>
<server/>
<web/>
<mobile/>
</classes>
<security>
</security>
<summary><glossary tag="return">Returns</glossary> the <glossary tag="IP address">IP address</glossary> of the local system a <glossary tag="socket">socket</glossary> is connected to.</summary>
<examples>
<example>the hostAddress of "www.example.com:80"</example>
<example>hostAddress("example.net:25|10")</example>
<example>the hostAddress of "127.0.0.1:8080|dataConnection"</example>
</examples>
<description>
<p>Use the <b>hostAddress</b> <control_st tag="function">function</control_st> to find the <glossary tag="IP address">IP address</glossary> of the computer that LiveCode is running on.</p><p/><p><b>Parameters:</b></p><p>The <i>host</i> is an <glossary tag="IP address">IP address</glossary> or <glossary tag="domain name">domain name</glossary>.</p><p/><p>The <i>port</i> is the number of the <glossary tag="port">port</glossary> the <glossary tag="socket">socket</glossary> is connected to.</p><p/><p>The <i>connectionID</i> is a <keyword tag="string">string</keyword> identifying the <glossary tag="socket">socket</glossary>.</p><p/><p><b>Value:</b></p><p>The <b>hostAddress</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> the <glossary tag="IP address">IP address</glossary> of the computer. This address is in the form X.X.X.X, where each X is a number with between 1 and 3 digits.</p><p/><p><b>Comments:</b></p><p>The socket must be open. If the specified socket has not been opened, the <b>hostAddress</b> <control_st tag="function">function</control_st> <glossary tag="return">returns</glossary> "not an open socket". If you have issued an <command tag="open socket">open socket</command> <glossary tag="command">command</glossary> to create the <glossary tag="socket">socket</glossary>, you cannot use the <b>hostAddress</b> <control_st tag="function">function</control_st> until after the <glossary tag="socket">socket</glossary> has been created and the <glossary tag="command">command</glossary> has completed.</p><p/><p>The <i>connectionID</i> is needed only if more than one <glossary tag="socket">socket</glossary> is connected to the same <glossary tag="port">port</glossary> of the same <glossary tag="disabled">host</glossary>. The <i>connectionID</i> is assigned by the <command tag="accept">accept</command> or <command tag="open socket">open socket</command> <glossary tag="command">command</glossary> that created the <glossary tag="socket">socket</glossary>.</p>
</description>
</doc>