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

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

A TCP service object.


Declaration

  define external TCPService function TCPServiceOpen
       at value integer port-number optional initial {0}
  as TCPServiceOpen


Purpose

A server program uses this function to create a TCP service port on which it will listen for incoming client-initiated service requests.

If TCPServiceOpen fails, it still returns a TCP service object. This failure object is in error and is closed.

When using TCPServiceOpen, you can specify either the port-number or the listen-socket-descriptor, but not both.

Argument:

Example 1:

  local TCPService omdemo-service

  set omdemo-service to TCPServiceOpen at 5600

Example 2:

  local TCPService omdemo-service
  local integer port

  set omdemo-service to TCPServiceOpen
  set port to TCPServiceGetPort omdemo-service
  output "The selected service port for omdemo-service is %d(port)%n"

Example 3:

  local TCPService omdemo-service
  local integer ListenSocketFd

  set ListenSocketFd to
     Some_How_Get_Me_A_Listen_Socket_Descriptor_At_Port (6000)
  set omdemo-service to TCPServiceOpen descriptor ListenSocketFd

      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:07 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.