HP X.25/9000 Programmer's Guide
Chapter 4 65
Sending and Receiving Data
Setting Buffer Thresholds and Sizes
Syntax for ioctl(X25_SET_FRAGMENT_SIZE)
The syntax for the ioctl(X25_SET_FRAGMENT_SIZE) system call and its
parameters are described below.
#include <x25/x25ioctls.h>
#include <x25/x25str.h>
int err;
int sd, size;
err = ioctl(sd, X25_SET_FRAGMENT_SIZE, &size);
sd Socket descriptor for a VC socket.
X25_SET_FRAGM
ENT_SIZE
Indicates that the inbound message fragment size is being changed.
size New value for the read fragment size. The range is from 0 to 32,767
where 0 indicates that all messages must be read with a single system
call.
err On successful completion,
err
is set to 0. Otherwise, a value of –1 is
returned and
errno
is set to indicate the error.
Changing the Size of Socket Buffers
You can set the message sizes for a socket using the setsockopt(2)
system call. It is important for the sockets to be able to handle the
largest possible message that will be sent or received over the network.
The default send and receive buffer size is 4096 bytes.
If your interface receives a message larger than the receive socket buffer
size, the data will be discarded, the circuit will be reset, and you will
receive an
OOB_VC_MSG_TOO_BIG
out-of-band event.
You can increase the size of a socket's send() or recv() buffer at any
time, but they can only be reduced before a connection is established.
Syntax for setsockopt()
The syntax for the setsockopt() system call and its parameters are
described below.
#include <sys/types.h>
#include <sys/socket.h>
int err;
int sd, level, optname, optval, optlen;
36960-90061.bk Page 65 Friday, November 10, 2000 3:42 PM










