beautypg.com

Solvline Eddy DK Ver 2.20 User Manual

Page 56

background image

Chapter 6. Library

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

-1:

Bind

failure

N: Handle number bound to UDP socket

Notice

SB_ReadUdp

Function

Reads data transmitted to UDP socket bound in network.

Format

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

Parameter Handle

Buffer

Buffer_Size

Handle number bound to UDP 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 client sends data to bound UDP socket, this function remembers
client’s IP address and socket number for SB_SendUdpServer to use.

6-13