3 % (c) The GRASP/AQUA Project, Glasgow University, 1998
5 \subsection[socketOpt.lc]{Setting/Getting socket opts}
10 #define NON_POSIX_SOURCE
12 #include "ghcSockets.h"
15 getSocketOption__ (fd, opt)
19 int level,optval, sz_optval,rc;
21 if ( opt == TCP_MAXSEG || opt == TCP_NODELAY ) {
27 sz_optval = sizeof(int);
29 while ( (rc = getsockopt((int)fd, level, opt, &optval, &sz_optval)) < 0 ) {
40 setSocketOption__ (fd, opt, val)
47 if ( opt == TCP_MAXSEG || opt == TCP_NODELAY ) {
55 while ( (rc = setsockopt((int)fd, level, opt, &optval, sizeof(optval))) < 0 ) {