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

tcp-connection

 
 

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


Purpose

The tcp-connection OMX component represents a connection to a remote machine using the TCP/IP (Transmission Control/Internet) protocol. Once the connection is made, you can communicate with the remote machine.

Usage Notes

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

     include "omtcp.xin"

The tcp-connection OMX component is not copyable. This means that when you set the value of one tcp-connection OMX variable to the value of another tcp-connection OMX variable, you end up with two variables pointing at the same external object. You are able to manipulate both variables, but those manipulations are being performed on the same TCP connection, whether you use the original tcp-connection OMX variable or its copy.

Example

Within your program, you can create as many instances of the tcp-connection OMX component as you require by declaring global and local variables of type "tcp-connection".

     include "omtcp.xin"
     
     global tcp-connection Connection-1
     global tcp-connection Connection-2
     
     process
        local tcp-connection Connection-3
        local tcp-connection Connection-4

Once you have declared your tcp-connection OMX variables, you can use those variables to create TCP connections to remote machines using the tcp-connect function in the TCP/IP legacy library.

     include "omtcp.xin"
     
     process
        local tcp-connection Connection-1
        
        set Connection-1 to tcp-connect on "banzai.com" at "5600"
        

Assuming no errors occur when establishing the connection to the remote machine, you can now communicate with that machine via the TCP protocol using the other tcp-connection functions.

        Other Library Functions
   tcp-accept-connection
   tcp-connect
   tcp-connection
   tcp-create-service
   tcp-destroy-service
   tcp-disconnect
   tcp-get
   tcp-has-characters
   tcp-is-connected
   tcp-is-version-compatible
   tcp-library-version
   tcp-peer-ip
   tcp-peer-name
   tcp-port
   tcp-put
   tcp-service
   tcp-set-buffering
   tcp-signal-source-end
   tcp-sink
   tcp-source
 
 

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.