www.beck-ipc.com

@CHIP-RTOS C Library V2.00 - TCP/IP API


getsockopt

Get options on a socket.

int getsockopt ( int sd, const GetSocketOption far *sockoptptr,
                 int *error );

Parameters

sd

Socket descriptor.

sockoptptr

Pointer to GetSocketOption type that specifies the socket options (see tcpipapi.h) and contains pointers to where the specified socket option will be reported to.

error

Output parameter:  Failure code, 0 on success.

Return Value

0 = success
Non-zero = Failure (see error output parameter)

Comments

On success, this function reports the requested socket option value to the buffer pointed to by the optionValue member of GetSocketOption type at sockoptptr and the length of this reported value is written to the location pointed to by the optionLen member.

The caller must setup the GetSocketOption type structure prior to calling.  In particular, the optionValue member must point to a sufficiently large buffer to receive the reported option value and the size of this buffer must be stated in the location referenced by the optionLen member.   Note that this length specifier is both an input and an output parameter for this function.  If on entry, the location referenced by optionLen contains a value less than the buffer space required to report the requested socket option value, then the function will fail and return error code 242.

The socket options of an incoming connection (using accept) will be the same as the socket options of the listening socket.

See Also

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.


This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document