TCP Communication

 

TCP communications is a client server communication protocol.  When a TCP connection is opened, it is either opened as a server or a client.  When a TCP connection is opened as a server, it is considered a passive open (i.e. the TCP listens for an incoming connection request).  When a TCP connection is opened as a client, it is considered an active open (i.e. the TCP actively pursues a connection to a listening server).

TCP connections also have a port number associated with the TCP communication connection.  The port number is specified after the host name (or IP address). See below.

To open a server end of a TCP connection with the IO control make a call as follows:

ret = IO1.Open ("localhost:9092", "server")
 

To open a client end of a TCP connection with the IO control make a call as follows:

ret = IO1.Open ("localhost:9092", "client")
 
 

To do subsequent communication via the newly opened connection, call the "Read" and "Write" functions of the IO control.  See the interface for the IO control for the specifics of the "Read" and "Write" functions.

See the VB "TCPTest" example in the "Samples" directory.

Note1: If you are communicating with a remote PC, you will need to replace "localhost" with either the host/computer name or the IP address of the PC (or device) you wish to communicate with.

Note2: Requires rev 2.01 of the IO Control.
 
 
 
 

Home Page
 
 
 
 
 
 
 
 
 

Copyright (c) 2002 by JS Payne