HP Rp7410 BSD Sockets Interface Programmer's Guide - Page 132
The server process should accept a connection after executing the listen
View all HP Rp7410 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 132 highlights
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
132
Chapter 6
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
.