swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
      Other Library Functions  
function  

netutil.host-ip

 
 

Library: Net, Network utilities (OMNETUTIL)
Import: omnetutl.xmd
Return type: String
Returns: 

The IP address of a host computer given its name.


Declaration

  define external stream function netutil.host-ip
     of value stream Host-Name optional

Argument definitions

Host-Name
is the name of the host computer you want to retrieve the IP address of.


Purpose

Use netutil.host-ip to retrieve the Internet Protocol (IP) address of a host computer, given its name.

Usage Notes

The IP address is returned in dotted decimal format (for example, "127.0.0.1").

If no host name is specified, netutil.host-ip returns the IP address of the local host. If netutil.host-ip fails to retrieve the IP address, it returns netutil.invalid-ip which is defined as "255.255.255.255".

Examples

This sample gets IP address of the host whose host name or alias is specified.

  import "omnetutil.xmd" prefixed by netutil.

  process
    local stream host initial {"www.stilo.com"}

    output "The ip address of " || host
        || " is: " || netutil.host-ip of host
        || "%n"

This sample gets the IP address of the local host.

  import "omnetutil.xmd" prefixed by netutil.

  process
    output "The ip address of this machine is: "
        || netutil.host-ip
        || "%n"

        Other Library Functions
   netutil.from-net32
   netutil.host-ip
   netutil.host-name
   netutil.net32
   netutil.omnetutil-version
   netutil.to-net32
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:33 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.