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

TCPServiceOpen

 
 

Library: TCP/IP client and server support (OMTCP legacy, OmniMark versions 4 - 6.0.1)
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
 
 

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

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:38:10 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.