From: Gisle Aas Date: Thu, 8 Dec 2005 09:53:35 +0000 (+0000) Subject: Improve the setsockopt description. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=23d0437f66972bc146b114c26cbf448ceea3e9e2;p=p5sagit%2Fp5-mst-13.2.git Improve the setsockopt description. Removed claim that OPTVAL might be undef as it is just treated the same as 0 and give the usual use-of-uninitialized-value warning. Added an example. p4raw-id: //depot/perl@26299 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 0127c82..2cb16d0 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -4926,8 +4926,15 @@ that doesn't implement setpriority(2). X Sets the socket option requested. Returns undefined if there is an -error. OPTVAL may be specified as C if you don't want to pass an -argument. +error. Use integer constants provided by the C module for +LEVEL and OPNAME. Values for LEVEL can also be obtained from +getprotobyname. OPTVAL might either be a packed string or an integer. +An integer OPTVAL is shorthand for pack("i", OPTVAL). + +An example disabling the Nagle's algorithm for a socket: + + use Socket qw(IPPROTO_TCP TCP_NODELAY); + setsockopt($socket, IPPROTO_TCP, TCP_NODELAY, 1); =item shift ARRAY X