HP Rp7410 BSD Sockets Interface Programmer's Guide - Page 131
pointer to
View all HP Rp7410 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 131 highlights
Using UNIX Domain Stream Sockets Writing the Server Process Accepting a Connection The server process can accept any connection requests that enter its queue after it executes listen. accept creates a new socket for the connection and returns the socket descriptor for the new socket. The new socket: • Is created with the same properties as the old socket. • Has the same bound pathname as the old socket. • Is connected to the client process' socket. accept blocks until there is a connection request from a client process in the queue, unless you are using nonblocking I/O. accept and its parameters are described in the following table. Include files: System call: #include #include #include s = accept(ls,addr,addrlen) int s; int ls; struct sockaddr_un *addr; int *addrlen; Parameter Contents INPUT Value OUTPUT Value s addr addrlen socket descriptor of local socket socket address length of address socket descriptor of server socket unchanged pointer to address structure where address will be put pointer to socket address of client socket that server's new socket is connected to pointer to the size of struct sockaddr_un pointer to the actual length of address returned in addr Chapter 6 131