the system error value (errno or WSAGetLastError()) will still be set to the result of the getsockopt() call.
Socket.getOption
bool getOption(int level, int optname, out int value)Gets the value of an integer-valued option on socket, as with getsockopt(). (If you need to fetch a non-integer-valued option, you will need to call getsockopt() directly.)
The [<gio/gnetworking.h>][gio-gnetworking.h] header pulls in system headers that will define most of the standard/portable socket options. For unusual socket protocols or platform-dependent options, you may need to include additional headers.
Note that even for socket options that are a single byte in size, value is still a pointer to a #gint variable, not a #guchar; [gio.socket.Socket.getOption] will handle the conversion internally.
Parameters
level | the "API level" of the option (eg, SOL_SOCKET) |
optname | the "name" of the option (eg, SO_BROADCAST) |
value | return location for the option value |
Returns
success or failure. On failure, error will be set, and
Throws
[ErrorWrap]