swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
  Related Syntax   Related Concepts   Other Library Functions  
function   TCPConnectionGetPeerName    

Library: omtcp - TCP/IP client and server support
Include: omtcp.xin
Return type: String
Returns:       

An official peer hostname or an IP address if no name is available.


Declaration

  define external stream function TCPConnectionGetPeerName
        value TCPConnection this-TCPConnection
  as TCPConnectionGetPeerName


Purpose

This function is used to get the official name of the peer host on the other side of the connection. If TCPConnectionGetPeerName fails to get the official name, it returns its IP address. The IP address is returned in a dotted decimal format (for example, "123.123.123.45").

If the passed TCPConnection object is closed or was never connected, then this function returns a distinct value that doesn't look like a valid peer name and causes the TCPConnection object to be in error. If no peer name is available, but the connection is legitimate, this function returns the peer's IP address.

Argument:

Example:

  local TCPService omdemo-service
  local TCPConnection client

  set omdemo-service to TCPServiceOpen at 5600

  repeat
     set client to TCPServiceAcceptConnection omdemo-service
     output "Request from " || "g"% TCPConnectionGetPeerName client || "%n"
     ;process request
  again

    Related Syntax
   TCPConnectionGetPeerIP
 
Related Concepts
   Security considerations
 
Other Library Functions
   TCPConnectionClose
   TCPConnectionGetCharacters
   TCPConnectionGetLine
   TCPConnectionGetOutput
   TCPConnectionGetPeerIP
   TCPConnectionGetPeerName
   TCPConnectionGetSource
   TCPConnectionGetStatusReport
   TCPConnectionHasCharactersToRead
   TCPConnectionIsConnected
   TCPConnectionIsInError
   TCPConnectionOpen
   TCPConnectionPut
   TCPConnectionSetBuffering
   TCPConnectionSignalSourceEnd
   TCPIsVersionCompatible
   TCPLibraryVersion
   TCPServiceAcceptConnection
   TCPServiceClose
   TCPServiceGetPort
   TCPServiceGetStatusReport
   TCPServiceIsInError
   TCPServiceIsOpen
   TCPServiceOpen
   TCPTraceConnectionOpen
 
----  

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

Generated: August 11, 2000 at 3:08:03 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.