<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 &amp; 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>