HP X.25/9000 Programmer's Guide
66 Chapter4
Sending and Receiving Data
Setting Buffer Thresholds and Sizes
optlen = sizeof(int);
err = setsockopt(sd, level, optname,(char*) &optval,
optlen);
sd Socket descriptor for a VC socket.
level Indicates the level at which the socket takes effect (this must be set to
SOL_SOCKET
).
optname Indicates the type of option to be modified. This can be
SO_SNDBUF
to
change the size of the send buffer, or
SO_RCVBUF
to change the size of the
receive buffer.
optval New send or receive buffer sizes (maximum 58,254).
optlen Length in bytes of the
optval
parameter (that is, sizeof(int)).
err On successful completion,
err
is set to 0. Otherwise, a value of –1 is
returned and
errno
is set to indicate the error.
Increasing the send socket buffer size lets users send more data before
their application blocks waiting for more buffer space. If more than one
message can not be sent without waiting for a reply, you may want to
increase the send buffer size to allow enough room to send multiple
messages.
NOTE Increasing the buffer size to send larger portions of data before the
application blocks may increase throughput, but the best way of tuning
performance is to experiment with various buffer sizes.
Refer to the setsockopt(2) entry in your HP-UX man pages for more
information.
36960-90061.bk Page 66 Friday, November 10, 2000 3:42 PM










