swirl Guide to OmniMark 5   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesOMX VariablesErrors
 
 
  TCPConnection    

The TCPConnection OMX component allows you to create 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.

The OmniMark TCP/IP dynamic link library file ("omtcp.dll" or "omtcp.so") creates the TCPConnection OMX component. The related include file ("omtcp.xin") defines the interface to that component. To use TCPConnection 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 TCPConnection OMX component as you require by declaring global and local variables of type "TCPConnection". For example:

     include "omtcp.xin"

     global TCPConnection my-tcpcon-1
     global TCPConnection my-tcpcon-2

     process
        local TCPConnection my-tcpcon-3
        local TCPConnection my-tcpcon-4

Once you have declared your TCPConnection OMX variables, you can use those variables to create TCP connections to remote machines using the TCPConnectionOpen function in the OmniMark TCP/IP library. For example:

     include "omtcp.xin"

     process
        local TCPConnection my-tcpcon

        set my-tcpcon to TCPConnectionOpen 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 TCPConnection functions.

The TCPConnection OMX component is not copyable. This means that when you set the value of one TCPConnection OMX variable to the value of another TCPConnection 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 TCPConnection OMX variable or its copy.

   
----  

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

Generated: August 11, 2000 at 3:08:02 pm
If you have any comments about this section of the documentation, send email to docerrors@omnimark.com

Copyright © OmniMark Technologies Corporation, 1988-2000.