|
|||||
|
||||||
Related Syntax | Other Library Functions |
OMX |
tcp.connection |
Library: TCP/IP client and server support (OMTCP)
Import: omtcp.xmd |
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.
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.
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.
Copyright © Stilo International plc, 1988-2008.