01.06.2013 Views

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

IPC@CHIP Documentation - SC12 @CHIP-RTOS V1.10

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Interrupt 0xAC service 0x19: API_REGISTERCALLBACK, Register a user callback function<br />

Parameters<br />

AH<br />

BX<br />

CX<br />

ES:DI<br />

Register a user callback function for events occurring on a TCP socket.<br />

0x19 (= API_REGISTERCALLBACK)<br />

Socket descriptor<br />

Event flag mask (see below)<br />

Pointer to callback function (see below)<br />

Return Value<br />

Comments<br />

DX = 0 success<br />

DX != 0 AX: contains error code<br />

The TCP/IP stack of the <strong>IPC<strong>@CHIP</strong></strong> is able to execute a registered user callback function, if one or more some<br />

specified events happens on a TCP socket connection.<br />

The callback function must be of the following type (Borland C):<br />

void huge socketCallBackFunc(int socketdescriptor,<br />

int eventFlags)<br />

Before closing a socket, you should remove the callback function. This is done by calling this API function with<br />

a null pointer in ES:DI and value 0 in register CX.<br />

The input parameter eventFlags to the callback is a bit field indicating the event(s) that have occurred.<br />

The set of events for either the CX event mask argument to this API or the eventFlags callback parameter<br />

are defined in TCPIPAPI.H as follows:<br />

#define CB_CONNECT_COMPLT 0x0001 // Connection complete<br />

#define CB_ACCEPT 0x0002 // Remote client has established<br />

// a connection to our listening server.<br />

#define CB_RECV 0x0004 // Incoming data arrived<br />

#define CB_SEND_COMPLT 0x0010 // Sending of data has been acked by the peer<br />

#define CB_REMOTE_CLOSE 0x0020 // Peer has shutdown the connection<br />

#define CB_SOCKET_ERROR 0x0040 // An error occurred on the connection<br />

#define CB_RESET 0x0080 // Peer has sent a rest on the connection<br />

#define CB_CLOSE_COMPLT 0x0100 // close has been completed<br />

Related Topics<br />

Top of list<br />

Index page<br />

API_REGISTERCALLBACK_PASCAL For Pascal callback functions<br />

Page 121 / 400

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!