beautypg.com

Solvline Eddy DK User Manual

Page 109

background image

Eddy DK Programmer Guide

109

SB_ListenTcp

Function

Wait for connection to TCP socket

Format

Int SB_ListenTcp (int Socket_No, Int Tx_Size, int Rx_Size);

Parameter

Socket_No
Tx_Bytes
Rx_Bytes

TCP socket number to wait for connection
Tx buffer size of the socket (in K bytes)
Rx buffer size of the socket (in K bytes)

Returns

-1 ~ N

Handle number of the TCP socket waiting for
connection
-1: Socket connection waiting failure
N: Handle number of the TCP socket waiting for
connection

Notice

As a non-blocking function, this function requests connection and
returns without waiting for connection. SB_AcceptTcp will handle waiting
for connection.
Tx,Rx_Size are size of the socket buffer size. These can be set from 1 to
64.
If it is set to number smaller than 1, size will 4kbytes as default; number
larger than 64 will set size of the buffer to 64kbytes as default.

SB_AcceptTcp

Function

Waits for network connection of TCP socket handle.

Format

Int SB_AcceptTcp (int Socket_No, int wait_msec);

Parameter

Socket_No

wait_msec

TCP socket handle number to wait for connection.
(Return value of SB_ListenTcp)
Connection standby time (in msec)

Returns

-1 ~ N

New handle number of connected TCP socket.
-1: Socket error
0: Waiting for connection
N: New handle number of connected TCP socket.

Notice

When new handle number is given after connection is made, previous
handle that has been waiting will be closed inside this function.