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

TCPServiceOpen

 
 

Library: TCP/IP client and server support (OMTCP) original
Include: omtcp.xin
Return type: TCPService
Returns: 

A TCPService object.


Declaration

  define external TCPService function TCPServiceOpen
      at          value integer port-number              optional
      descriptor  value integer ListenSocketDescriptor   optional
      queue-size  value integer ListenQueueSize          optional
      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

        Other Library Functions
   TCPConnection
   TCPConnectionClose
   TCPConnectionGetCharacters
   TCPConnectionGetLine
   TCPConnectionGetOutput
   TCPConnectionGetPeerIP
   TCPConnectionGetPeerName
   TCPConnectionGetSource
   TCPConnectionGetStatusReport
   TCPConnectionHasCharactersToRead
   TCPConnectionIsConnected
   TCPConnectionIsInError
   TCPConnectionOpen
   TCPConnectionPut
   TCPConnectionSetBuffering
   TCPConnectionSignalSourceEnd
   TCPIsVersionCompatible
   TCPLibraryVersion
   TCPService
   TCPServiceAcceptConnection
   TCPServiceClose
   TCPServiceGetPort
   TCPServiceGetStatusReport
   TCPServiceIsInError
   TCPServiceIsOpen
   TCPServiceOpen
   TCPTraceConnectionOpen
 
 

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

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

Copyright © Stilo Corporation, 1988-2005.