Set default socket size for netreceive to 128k to reduce the chances

of the buffer overflowing before netreceive can be scheduled to read
the packets from the socket.
This commit is contained in:
Robert Watson 2004-09-21 03:10:28 +00:00
parent 78366bad6c
commit 98da5dfbb2

View file

@ -52,7 +52,7 @@ main(int argc, char *argv[])
struct sockaddr_in sin;
char *dummy, *packet;
long port;
int s;
int s, v;
if (argc != 2)
usage();
@ -80,6 +80,12 @@ main(int argc, char *argv[])
return (-1);
}
v = 128 * 1024;
if (setsockopt(s, SOL_SOCKET, SO_RCVBUF, &v, sizeof(v)) < 0) {
perror("SO_RCVBUF");
return (-1);
}
if (bind(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
perror("bind");
return (-1);