HPlogo

HP 9000 Networking: BSD Sockets Interface Programmer's Guide

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Glossary

 » Index

HP Part Number: B2355-90136

Edition: Edition 6

Published: E0497


Table of Contents

Printing History
Preface
1 BSD Sockets Concepts
Introduction
Key Terms and Concepts
How You Can Use BSD Sockets
The Client-Server Model
Creating a Connection: the Client-Server Model
BSD Sockets Library Routines
2 Using Internet Stream Sockets
Overview
Preparing Address Variables
Declaring Socket Address Variables
Getting the Remote Host's Internet Address
Getting the Port Address for the Desired Service
Using a Wildcard Local Address
Writing the Server Process
Creating a Socket
Binding a Socket Address to the Server Process's Socket
Setting Up the Server to Wait for Connection Requests
Accepting a Connection
Writing the Client Process
Creating a Socket
Requesting a Connection
Sending and Receiving Data
Sending Data
Receiving Data
Flag Options
Closing a Socket
Example Using Internet Stream Sockets
3 Advanced Topics for Stream Sockets
Socket Options
Getting and Setting Socket Options
SO_REUSEADDR
SO_KEEPALIVE
SO_DONTROUTE
SO_SNDBUF
SO_RCVBUF
SO_LINGER
SO_USELOOPBACK
SO_OOBINLINE
SO_SNDLOWAT
SO_RCVLOWAT
SO_SNDTIMEO
SO_RCVTIMEO
SO_TYPE
SO_ERROR
SO_BROADCAST
SO_REUSEPORT
Synchronous I/O Multiplexing with Select
Sending and Receiving Data Asynchronously
Nonblocking I/O
Using Shutdown
When to Shut Down a Socket
Using Read and Write to Make Stream Sockets Transparent
Sending and Receiving Out-of-band Data
4 Using Internet Datagram Sockets
Overview
Preparing Address Variables
Declaring Socket Address Variables
Getting the Remote Host's Network Address
Getting the Port Address for the Desired Service
Using a Wildcard Local Address
Writing the Server and Client Processes
Creating Sockets
Binding Socket Addresses to Datagram Sockets
Sending and Receiving Messages
Sending Messages
Receiving Messages
Flag Options
Closing a Socket
Example Using Datagram Sockets
5 Advanced Topics for Internet Datagram Sockets
SO_BROADCAST Socket Option
Specifying a Default Socket Address
When to Specify a Default Socket Address
Synchronous I/O Multiplexing with Select
Sending and Receiving Data Asynchronously
Sending and Receiving IP Multicast Datagrams
Sending IP Multicast Datagrams
Receiving IP Multicast Datagrams
Nonblocking I/O
Using Broadcast Addresses
6 Using UNIX Domain Stream Sockets
Overview
Preparing Address Variables
Declaring Socket Address Variables
Writing the Server Process
Creating a Socket
Binding a Socket Address to the Server Process's Socket
Setting the Server Up to Wait for Connection Requests
Accepting a Connection
Writing the Client Process
Creating a Socket
Requesting a Connection
Sending and Receiving Data
Sending Data
Receiving Data
Flag Options
Closing a Socket
Example Using UNIX Domain Stream Sockets
7 Using UNIX Domain Datagram Sockets
Overview
Preparing Address Variables
Declaring Socket Address Variables
Writing the Server and Client Processes
Creating Sockets
Binding Socket Addresses to UNIX Domain Datagram Sockets
Sending and Receiving Messages
Sending Messages
Receiving Messages
Closing a Socket
Example Using UNIX Domain Datagram Sockets
8 Programming Hints
Troubleshooting
Using Diagnostic Utilities as Troubleshooting Tools
Adding a Server Process to the Internet Daemon
Summary Tables for System and Library Calls
Portability Issues
Porting Issues for IPC Functions and Library Calls
Porting Issues for Other Functions and Library Calls Typically Used by IPC
A BSD Sockets Quick Reference Table
Quick Reference Table
Glossary
Index
© 1997 Hewlett-Packard Development Company, L.P.