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

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

Advertisement

Using UNIX Domain Stream Sockets
Writing the Server Process
Function result: socket descriptor of new socket if accept is successful,
–1 if failure occurs.
Example:
struct sockaddr_un peeraddr;
...
addrlen = sizeof(sockaddr_un);
s = accept (ls, &peeraddr, &addrlen);
There is no way for the server process to indicate which requests it can
accept. It must accept all requests or none.
When to Accept a Connection
The server process should accept a connection after executing the listen
call. Refer to the accept(2) man page for more information on accept.
132
Chapter 6

Advertisement

Table of Contents
loading

Table of Contents