swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax     Other Library Functions  
OMX  

TCPService

 
 

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


Purpose

The TCPService OMX component allows you to write a server program that accepts TCP connections from remote client machines using the TCP (Transmission Control) protocol. Once the connection is made, you can communicate with the client machine.

The OmniMark TCP dynamic link library file ("omtcp.dll" or "omtcp.so") creates the TCPService OMX component. The related include file ("omtcp.xin") defines the interface to that component. To use TCPService components in your program, you must include the following declaration and include statement in your program:

     include "omtcp.xin"

Within your program, you can create as many instances of the TCPService OMX component as you require by declaring global and local variables of type "TCPService". For example:

     include "omtcp.xin"
     
     global TCPService my-tcpservice-1
     global TCPService my-tcpservice-2
     
     process
        local TCPService my-tcpservice-3
        local TCPService my-tcpservice-4

Once you have declared your TCPService OMX variables, you can use those variables to create a TCP service on your machine. For example:

     include "omtcp.xin"
     
     process
        local TCPService my-tcpservice
        
        set my-tcpservice to TCPServiceOpen at 5600

Assuming that no errors occur when setting up the service, remote machines are now able to create a TCP connection with your system on the port you specified.

The TCPService OMX component is not copyable. This means that when you set the value of one TCPConnection OMX variable to the value of another TCPService OMX variable, you end up with two variables pointing at the same OMX component. You are able to get information about the TCP service through both variables, but that information is coming from the same external object whether you use the original TCPService OMX variable or its copy.

    Related Syntax
   TCPServiceOpen
   TCPServiceClose
   TCPServiceIsInError
   TCPServiceGetStatusReport
   TCPServiceAcceptConnection
   TCPServiceIsOpen
   TCPTraceConnectionOpen
   TCPServiceGetPort
 
  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 ] [ 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.