Solvline Eddy DKV2.1.0.3 User Manual

Page 90

Advertising
background image

Chapter 6. Library

Introduction

90

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
0: No data was read
N: Length of the data read

Notice

When return code is -1, it means the connection is lost with the client so
user has to close TCP socket handle.

SB_CloseTcp

Function

Close TCP socket handle.

Format

Int SB_CloseTcp (int Handle);

Parameter

Handle

TCP socket handle number to close

Returns

None

Notice

This function shuts down socket handle to finish communication and
closes.

SB_BindUdp

Function

Binds UDP socket.

Format

Int SB_BindUdp (int Socket_No);

Parameter

Socket_No

UDP socket number to bind

Returns

Handle

Handle number bound to UDP socket

Advertising