Metrologic Optimus S Programming Manual page 157

"c" programming guide
Table of Contents

Advertisement

Return
If successful, it returns 0.
On error, it returns -1.
The global variable errno is set to indicate the error condition encountered.
See Also
bind, connect, getpeername
getsockopt
To get options on a socket.
Purpose
Syntax
int getsockopt (SOCKET s, int level, int optname, char *optval, int *optlen);
s
level
optname
optval
optlen
Example
(?)
Description
This routine retrieves the current value for a socket option associated with a
socket of any type, in any state, and stores the result in optval.
Although options may exist at multiple protocol levels, they are always present
at the uppermost socket level. Options affect socket operations, such as the
packet routing and OOB data transfer.
Chapter 3 Terminal Specific Function Library
The name is a result parameter that is filled in with the address of the
connecting entity, as known to the communications layer. The exact
format of the name parameter is determined by the address family in
which the communication is occurring.
The namelen is a value-result parameter; it initially contains the amount of
space pointed to by name; on return, it will contain the actual length, in
bytes, of the address returned. The name is truncated if the buffer provided
is too small. (?)
Descriptor identifying a socket.
Level at which the option resides:
SOL_SOCKET, IPPROTO_TCP, or IPPROTO_IP
Socket option for which the value is to be retrieved.
Pointer to the buffer in which the value for the requested
option is to be returned.
Pointer to the size of the optval buffer, in bytes.
To manipulate options at the socket level, level is specified as
SOL_SOCKET.
To manipulate options at any other level, the protocol number of the
appropriate protocol controlling the option is supplied.
For example, the following options are recognized:
level = SOL_SOCKET
SO_DEBUG
Enables recording of debugging information
SO_REUSEADDR
Enables local address reuse
SO_KEEPALIVE
Enables sending keep-alives
151

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents