Adjusting Socket Options
Sockets have options that control various aspects of their operation. Among the things you can adjust are the sizes of the buffers used to send and receive data, the values of send and receive timeouts, and whether the socket can be used to receive broadcast transmissions.
The default options are fine for most purposes; however, occasionally you may want to adjust some options to optimize your application, or to enable optional features of the TCP/IP protocol. The most commonly used option is SO_REUSEADDR, which is frequently activated in server applications.
Socket options can be examined or changed with the Perl built-in functions getsockopt() and setsockopt().
|
$value = getsockopt (SOCK,$level,$option_name);
|
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access