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.

Socket descriptor<br />

Return Value<br />

DX = 0 success AX: 0<br />

DX = -1 = API_ERROR AX: contains error code<br />

Related Topics<br />

Top of list<br />

Index page<br />

Open socket API_OPENSOCKET<br />

Interrupt 0xAC service 0x03: API_BIND, bind TCP or UDP server socket<br />

Parameters<br />

AH<br />

BX<br />

DX:SI<br />

Bind a unnamed socket with an IP address and port number.<br />

0x03 (= API_BIND)<br />

Socket descriptor<br />

Pointer to a sockaddr_in structure, the first three elements of which must be filled in by caller prior to<br />

calling.<br />

Return Value<br />

Comments<br />

DX = 0 success AX: 0<br />

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

The bind call sets a specific port number as an application's source port number. Otherwise a random 16-bit<br />

source port number will be used when no bind call is made.<br />

The bind call is necessary for server applications in order that clients can connect to them at the agreed upon<br />

("well known") port number.<br />

The older TCP and UDP echo client examples also used a bind call, but this was not necessary. If you use<br />

the bind call in a client application, the client uses the given port number as its own source port number.<br />

Related Topics<br />

Top of list<br />

Index page<br />

Get IP address of the Ethernet interface<br />

Convert ASCII IP address to binary<br />

For proper port number byte order: htons function<br />

Page 107 / 400

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

Saved successfully!

Ooh no, something went wrong!