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.

Programming client server applications - <strong>SC12</strong> <strong>@CHIP</strong>-<strong>RTOS</strong> <strong>V1.10</strong><br />

<strong>IPC<strong>@CHIP</strong></strong> <strong>Documentation</strong> Index<br />

Client-Server<br />

Programming client/server applications<br />

Here is a short description for programming client/server applications with the TCP/IP API.<br />

The most used methods for programming TCP/IP applications are client or server applications.<br />

The term server applies to any process or program that offers a service that can be reached over the network.<br />

Servers accept request that arrive over the network, perform their service, and return the result to the requester.<br />

An example for the simplest service is the standard echo server application. The server echoes the received<br />

data over the network back to the requester. A process becomes a client when its sends a request to a server<br />

and waits for an answer. the client-server model is the standard model for interprocess communication. A<br />

TCP/IP stack provides two different methods for client-server connections:<br />

1.UDP protocol:<br />

This protocol realizes connectionless communication between a client and server, based on sending and<br />

receiving of single datagrams.<br />

TCP/IP API calls for an UDP client:<br />

● Open a socket<br />

● Send an outgoing datagram usually a prerecorded endpoint address.<br />

● Receive the next incoming datagram and record its source endpoint address.<br />

● Close a socket<br />

TCP/IP API calls for an UDP server:<br />

● Open a socket<br />

● Bind a socket, assign an address to an unnamed socket<br />

● Receive the next incoming datagram and record its source endpoint address.<br />

● Send an outgoing datagram usually a prerecorded endpoint address.<br />

2.TCP protocol:<br />

The TCP protocol is a connection- and byte stream-oriented protocol<br />

TCP/IP API calls for a TCP client:<br />

● Open a socket<br />

● Connect to a remote peer<br />

● Send an outgoing stream of characters<br />

Page 181 / 400

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

Saved successfully!

Ooh no, something went wrong!