Perl getsockopt Function Perl Scripting

what is Perl getsockopt function?

Description

This function gets the socket options set on SOCKET at the socket implementation level LEVEL for the option OPTNAME. Some sample values for OPTNAME at a socket level are given in Table below -
What exactly is in the packed string depends in the LEVEL and OPTNAME, consult your system documentation for details.

Syntax

Following is the simple syntax for this function −

Return Value

This function returns undef on error otherwise option value in scalar context.

Example

Following is the example code showing its basic usage, this will check if Nagle's algorithm is turned on on a socket. But, here you would have to open one socket to provide socked ID in this example −

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Perl Scripting Topics