HP Rp3440-4 - 9000 - 0 MB RAM Programmer's Manual page 94

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

Advertisement

Using Internet Datagram Sockets
Writing the Server and Client Processes
Parameter
Description of Contents
s
socket descriptor of local
socket
addr
socket address
addrlen
length of socket address
Function result: 0 if bind is successful, –1 if failure occurs.
Example:
struct sockaddr_in myaddr;
...
bind (s, &myaddr, sizeof(struct sockaddr_in));
When to Bind Socket Addresses
The client and server process should bind socket addresses after the
socket is created and before any other BSD Sockets system calls. Refer to
the bind(2) man page for more information on bind.
94
INPUT Value
socket descriptor of
socket to be bound
pointer to address to be
bound to s
size of struct
sockaddr_in_address
Chapter 4

Advertisement

Table of Contents
loading

Table of Contents