
Chapter 3 Terminal Specific Function Library
151
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. (?)
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
Purpose
To get options on a socket.
Syntax
int getsockopt (SOCKET s, int level, int optname, char *optval, int *optlen);
s
Descriptor identifying a socket.
level
Level at which the option resides:
SOL_SOCKET, IPPROTO_TCP, or IPPROTO_IP
optname
Socket option for which the value is to be retrieved.
optval
Pointer to the buffer in which the value for the requested
option is to be returned.
optlen
Pointer to the size of the
optval
buffer, in bytes.
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.
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
Содержание Optimus R
Страница 1: ...Printed on 20 March 2006 C Programming Guide Version 3 04 02 Optimus S Optimus R...
Страница 6: ......
Страница 8: ...2 C Programming Guide For Optimus S R...
Страница 12: ...6 C Programming Guide For Optimus S R The flow is illustrated as shown below...
Страница 23: ...Chapter 2 Development Environment 17 Different types signed unsigned Different types same size...
Страница 24: ...18 C Programming Guide For Optimus S R...
Страница 220: ...214 C Programming Guide For Optimus S R See Also FlashSize free_memory...
Страница 232: ...226 C Programming Guide For Optimus S R 4 11 Implementation defined Limits limits h float h Refer to limit h and float h...
Страница 238: ...232 C Programming Guide For Optimus S R...