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

NETGetHostName

 
 

Library: Network utilities (OMNETUTL) legacy library
Include: omnetutl.xin
Return type: String

Returns: Name of a host computer given its IP address.


Declaration

define external stream function NETGetHostName
   By-IP value string Host-IP optional

Argument definitions

Host-IP
is the dotted decimal format IP address of the host computer you want to retrieve the name of.


Purpose

Use NETGetHostName to retrieve the official name of a host computer given its Internet Protocol (IP) address.

Requirements

You must include the following line at the beginning of your OmniMark program:

  include "omnetutl.xin"

The IP address must be specified in dotted decimal format (for example, "127.0.0.1").

Usage Notes

If no IP address is specified, NETGetHostName returns the name of the local host. If this function fails to retrieve the host name, it returns the passed IP address.

Example


  ; get the official host name given its IP
    
  include "omnetutl.xin"
  
  process
    local stream host
    set host to "206.116.41.138"
    output "ip of %g(host) is: <" || NETGetHostName By-IP host || ">%n"
  
    ; get the name of the local host
    ;
    output "Local host name is: <" || NETGetHostName || ">%n"

        Other Library Functions
   from-net-long
   NETGetHostIP
   NETGetHostName
   NETIsVersionCompatible
   NETLibraryVersion
   net-long
   to-net-long
 
 

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

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.