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

tcp.connection

 
 

Library: TCP/IP client and server support (OMTCP)
Import: omtcp.xmd


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 module definition file ("omtcp.xmd") defines the interface to that component.

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".

     import "omtcp.xmd" prefixed by tcp.
     
     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 theOmniMark TCP/IP library.

     import "omtcp.xmd" prefixed by tcp.
     
     process
        local tcp.connection Connection-1
        
        set Connection-1 to tcp.connect to "banzai.com" on "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.

    Related Syntax
   tcp.disconnect
   tcp.writer
   tcp.get-string
   tcp.peer-ip
   tcp.peer-name
   tcp.reader
   tcp.is-connected
   tcp.put-string
   tcp.connect
 
  Other Library Functions
   tcp.accept-connection
   tcp.connect
   tcp.connection
   tcp.create-service
   tcp.destroy-service
   tcp.disconnect
   tcp.end-delimited
   tcp.get-string
   tcp.is-connected
   tcp.multi-packet
   tcp.omtcp-version
   tcp.peer-ip
   tcp.peer-name
   tcp.port
   tcp.put-string
   tcp.reader
   tcp.service
   tcp.set-buffering
   tcp.single-packet
   tcp.terminate-reader
   tcp.wait-for-input
   tcp.writer
 
 

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.