Jetter JC-120MC User Manual page 495

Table of Contents

Advertisement

JC-120MC
Using this function with
a TCP/IP connection
Functioning principle
with a TCP/IP connection
Using this function with
a UDP/IP server
Jetter AG
If data are to be received via a TCP/IP connection, you can invoke the function
and assign the return value of a variable for further evaluation as follows:
Result := ConnectionReceiveData(hConnection,
When using TCP/IP, data are sent via a previously opened connection.
Therefore, specification of the IP address and IP port number is not required
any more and can be ignored in the function.
In the following cases, the task is not processed further after issuing the
function call:
The data have been received
An error has occurred
In case of a TCP/IP connection, data are transmitted as data stream.
The device JC-120MC processes this function in the following steps:
Step
1
The device JC-120MC waits until data have been received, but no longer
than the specified timeout.
2
the timeout has elapsed or the
connection has been terminated,
data have been received,
3
more data have been received than
could have been copied into the
receiving buffer,
4
The function is exited and the number of data, which have been copied
into the receiving buffer, is returned.
If, with a server, data are to be received via a UDP/IP connection, you can
invoke the function and assign the return value of a variable for further
evaluation as follows:
Result := ConnectionReceiveData(hConnection,
Dummy,
Dummy,
ReceiveBuffer,
sizeof(ReceiveBuffer),
T#10s);
Description
If ...
the function is exited and an error
message is issued.
they are copied to the receiving
buffer given along with the data (but
not exceeding the amount given
along with the data). Then, the
function continues with stage 3.
If ...
these are buffered by the JC-120MC
to be fetched by further function
calls.
IPAddr,
IPPort,
ReceiveBuffer,
sizeof(ReceiveBuffer),
T#10s);
Programming
... then ...
... then ...
495

Advertisement

Table of Contents
loading

Table of Contents