HP Rp5405 BSD Sockets Interface Programmer's Guide - Page 134
client process can send data.
View all HP Rp5405 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 134 highlights
NOTE Using UNIX Domain Stream Sockets Writing the Client Process Requesting a Connection Once the server process is listening for connection requests, the client process can request a connection with the connect call. connect and its parameters are described in the following table. Include files: System call: #include #include #include connect(s, addr, addrlen) int s; struct sockaddr_un *addr; int addrlen; Parameter Description of Contents INPUT Value s addr addrlen socket descriptor of local socket pointer to the socket address length of addr socket descriptor of socket requesting a connection pointer to the socket address of the socket to which client wants to connect size of address structure pointed to by addr Function result: 0 if connect is successful, -1 if failure occurs. Example: struct sockaddr_un peeraddr; ... connect (s, &peeraddr, sizeof(struct sockaddr_un)); connect initiates a connection. When the connection is ready, the client process completes its connect call and the server process can complete its accept call. The client process does not get feedback that the server process has completed the accept call. As soon as the connect call returns, the client process can send data. 134 Chapter 6