Establishing A Connection - Jetter JC-120MC User Manual

Table of Contents

Advertisement

10 Programming

Establishing a connection

Introduction
Function declaration
Function parameters
Return value
488
Before data can be sent or received, a connection has to be established.
Here, the following criteria have to be discerned:
Which transaction log (TCP or UDP) has to be used?
Is it a client or a server that has to be installed?
Function ConnectionCreate(ClientServerType:Int,
Description of the function parameters:
Parameter
ClientServerType
IPType
IPAddr
IPPort
Timeout
If the return value was positive, the connection could be established. If the
returned value was negative, an error occurred and the connection could not
be established.
Return value
> 0
A positive return value must be stored in a variable. It must
be made available as a handle at activating the functions
Send data, Receive data, and Terminate connection.
-1
Error during connection set-up
-2
Internal error
-3
Invalid parameter
-8
Timeout
IPType:Int,
IPAddr:Int,
IPPort:Int,
Timeout:Int):Int;
Value
Client = 1 =
CONNTYPE_CLIENT
Server = 2 =
CONNTYPE_SERVER
UDP/IP = 1 =
IPTYPE_UDP
TCP/IP = 2 =
IPTYPE_TCP
Valid IP address
Valid IP port number
0 ... 1,073,741,824 [ms]
Comment
Required only for TCP/IP
client
Will be ignored for UDP/IP
client
0 = infinitely
Jetter AG

Advertisement

Table of Contents
loading

Table of Contents