static int iterations = 1;
static int transfer_size = 1000;
static int transfer_count = 1000;
+static int buffer_size;
static char test_name[9] = "custom";
static char *port = "7471";
static char *dst_addr;
long long bytes;
socklen_t size;
- bytes = transfer_size * transfer_count * iterations;
+ bytes = transfer_size * transfer_count;
for (optname = SO_SNDBUF; ; optname = SO_RCVBUF) {
size = sizeof val;
ret = rs_getsockopt(rs, SOL_SOCKET, optname, (void *) &val, &size);
if (ret)
break;
- if (val < bytes) {
- size = sizeof val;
- val = ((val << 2) > bytes) ? bytes : (val << 2);
- rs_setsockopt(rs, SOL_SOCKET, optname, (void *) &val, size);
+ if (val < bytes || buffer_size) {
+ size = sizeof buffer_size;
+ if (!buffer_size)
+ buffer_size = ((val << 2) > bytes) ? bytes : (val << 2);
+ rs_setsockopt(rs, SOL_SOCKET, optname,
+ (void *) &buffer_size, size);
}
if (optname == SO_RCVBUF)
{
int op, ret;
- while ((op = getopt(argc, argv, "s:b:I:C:S:p:T:")) != -1) {
+ while ((op = getopt(argc, argv, "s:b:B:I:C:S:p:T:")) != -1) {
switch (op) {
case 's':
dst_addr = optarg;
case 'b':
src_addr = optarg;
break;
+ case 'B':
+ buffer_size = atoi(optarg);
+ break;
case 'I':
custom = 1;
iterations = atoi(optarg);
printf("usage: %s\n", argv[0]);
printf("\t[-s server_address]\n");
printf("\t[-b bind_address]\n");
+ printf("\t[-B buffer_size]\n");
printf("\t[-I iterations]\n");
printf("\t[-C transfer_count]\n");
printf("\t[-S transfer_size or all]\n");
.SH SYNOPSIS
.sp
.nf
-\fIrstream\fR [-s server_address] [-b bind_address]
+\fIrstream\fR [-s server_address] [-b bind_address] [-B buffer_size]
[-I iterations] [-C transfer_count]
[-S transfer_size] [-p server_port] [-T test_option]
.fi
\-b bind_address
The local network address to bind to.
.TP
+\-B buffer_size
+Indicates the size of the send and receive network buffers.
+.TP
\-I iterations
The number of times that the specified number of messages will be
exchanged between the client and server. (default 1000)