beautypg.com

Solvline Eddy DK Ver 2.20 User Manual

Page 55

background image

Chapter 6. Library

6-12

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.

SB_AcceptTcpMulti

Function

Grants network multiple connection of TCP socket handle waiting for
connection.

Format

Int SB_AcceptTcpMulti (int Socket_No, int wait_msec);

Parameter Socket_No

wait_msec

TCP socket handle number waiting 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, it will not close
previous handle waiting for connection, granting maximum of 1024 socket
connection.

SB_ReadTcp

Function

Read data from connected TCP socket.

Format

Int SB_ReadTcp (int Handle, char *Buffer, int Buffer_Size);

Parameter Handle

Buffer

Buffer_Size

Handle number of connected TCP socket

Buffer point where packet data to be read will be saved

Size of the buffer to save

Returns

-1 ~ N

Size of the data read.

-1: Socket error