Table Of Contents - HP Rp3440-4 - 9000 - 0 MB RAM Programmer's Manual

Bsd sockets interface programmer’s guide
Hide thumbs Also See for Rp3440-4 - 9000 - 0 MB RAM:
Table of Contents

Advertisement

Contents
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
Key Terms and Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .17
How You Can Use BSD Sockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20
The Client-Server Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .21
Creating a Connection: the Client-Server Model . . . . . . . . . . . . . . . . .21
BSD Sockets Library Routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .25
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29
Preparing Address Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31
Declaring Socket Address Variables . . . . . . . . . . . . . . . . . . . . . . . . . . .31
Getting the Remote Host's Internet Address . . . . . . . . . . . . . . . . . . . .32
Getting the Port Address for the Desired Service . . . . . . . . . . . . . . . .33
Using a Wildcard Local Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .34
Writing the Server Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Creating a Socket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .35
Accepting a Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38
Writing the Client Process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
Creating a Socket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .40
Requesting a Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41
Sending and Receiving Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43
Sending Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .43
Receiving Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44
Flag Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
Closing a Socket. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47
5

Advertisement

Table of Contents
loading

Table of Contents