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"
16 getSocketOption__ (fd, opt)
20 int level,optval, sz_optval,rc;
22 if ( opt == TCP_MAXSEG || opt == TCP_NODELAY ) {
28 sz_optval = sizeof(int);
30 while ( (rc = getsockopt((int)fd, level, opt, &optval, &sz_optval)) < 0 ) {
41 setSocketOption__ (fd, opt, val)
48 if ( opt == TCP_MAXSEG || opt == TCP_NODELAY ) {
56 while ( (rc = setsockopt((int)fd, level, opt, &optval, sizeof(optval))) < 0 ) {