beautypg.com

Solvline Eddy DK Ver 2.20 User Manual

Page 54

background image

Chapter 6. Library

SB_ConnectTcp

Function

Make connection to the server specified as TCP socket.

Format

Int SB_ConnectTcp (char *IP_Address, int Socket_No, int Wait_Sec,

Int Tx_Size, int Rx_Size);

Parameter

IP_Address

IP address to connect in string type

Socket_No

Wait_Sec

Tx_Size

Rx_Size

Socket number of the server to connect

Wait time for connection (in second)

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 connected socket

-1: Connection failure

N: Handle number of the connected socket

Notice

If the connection is not made when this function is called, it will try to re-
connect for time specified in wait_sec and return.

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_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

6-11