HP Rp7410 BSD Sockets Interface Programmer's Guide - Page 67
So_dontroute, So_sndbuf, So_rcvbuf
View all HP Rp7410 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 67 highlights
NOTE Advanced Topics for Stream Sockets Socket Options SO_DONTROUTE This option is AF_INET socket-specific. SO_DONTROUTE indicates that outgoing messages should bypass the standard routing facilities. Instead, messages are directed to the appropriate network interface according to the network portion of the destination address. SO_SNDBUF SO_SNDBUF changes the send socket buffer size. Increasing the send socket buffer size allows a user to send more data before the user's application will block, waiting for more buffer space. Increasing buffer size to send larger portions of data before the application blocks may increase throughput, but the best method of tuning performance is to experiment with various buffer sizes. You can increase a stream socket's buffer size at any time, but decrease it only prior to establishing a connection. The maximum buffer size for stream sockets is 262144 bytes. Here is an example: int result; int buffsize = 10,000; result = setsockopt(s, SOL_SOCKET, SO_SNDBUF, &buffsize, sizeof(buffsize)); SO_RCVBUF SO_RCVBUF changes the receive socket buffer size. You can increase a stream socket's buffer size at any time, but decrease it only prior to establishing a connection. The maximum buffer size for stream sockets is 262144 bytes. Here is an example: int result; int buffsize = 10,000; result=setsockopt(s,SOL_SOCKET,SO_RCVBUF,&buffsize,sizeof (buffsize)); Chapter 3 67