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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

for the API_SEND function (or recv_params structure for API_RECV function). If flag is set to MSG_DONTWAIT<br />

the send call returns immediately. As much data as fits into the internal TCP buffer is accepted for transmission and<br />

the transmit byte count is returned in AX. If none of the data fits then -1 is returned in DX and error code 235 in AX.<br />

If flag is set to MSG_BLOCKING, the send call blocks until enough internal buffer space is available or a socket error<br />

occurs. By default the blocking mode is set for all sockets at the open call. If a socket has been set to non-blocking<br />

with the API_SETBLOCKINGMODE function, the MSG_BLOCKING flag is ignored and the call will be non-blocking.<br />

Top of list<br />

Index page<br />

Interrupt 0xAC service 0x10: API_RECV, Receive TCP message<br />

Parameters<br />

AH<br />

BX<br />

DX:SI<br />

For TCP only, this API receives a message from another socket.<br />

0x10 (= API_RECV)<br />

Socket Descriptor<br />

Pointer to recv_params structure which must be filled in by user.<br />

Return Value<br />

Comments<br />

DX = 0 success, AX: number of received bytes; 0 bytes implies timeout<br />

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

API_RECV may only be used when the socket is in a connected state.<br />

On success, the return value in AX contains the number of bytes which were successfully inserted into the<br />

caller's receive buffer at recv_params.bufferPtr.<br />

The length of the message returned could also be smaller than the parameter bufferlength of the recv_param<br />

structure. This is not an error.<br />

If flag member of recv_params structure is set to MSG_DONTWAIT, the API_RECV call returns<br />

immediately. If no data is available -1 is returned in DX with error code 235 in AX. If flag is set to<br />

MSG_BLOCKING, the API_RECV call waits for a message to arrive.<br />

By default the blocking mode is set for all sockets at the open call. If a socket was set to non-blocking with the<br />

API_SETBLOCKINGMODE function, the MSG_BLOCKING flag is ignored and the call will be non-blocking.<br />

Related Topics<br />

Top of list<br />

Index page<br />

API_SEND - Send TCP data<br />

API_RECVFROM - Receive UDP datagram<br />

Page 115 / 400

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

Saved successfully!

Ooh no, something went wrong!