www.beck-ipc.com

@CHIP-RTOS C Library - TCP/IP API


opensocket_ext

Open an IPv4 or IPv6 socket.

int opensocket_ext(int family, unsigned char type, int *error);

Parameters

family

address family AF_INET (2) for IPv4 or AF_INET6 (28) for IPv6

type

SOCK_STREAM = 1 for TCP socket
SOCK_DGRAM = 2 for UDP datagram socket.

error

Output parameter:  Failure code, 0 on success.

Return Value

-1: Failure (see error output parameter)
else socket descriptor

Comments

Creates an endpoint for communication and returns a socket descriptor.

This legacy function is equivalent to the BSD compatible socket() functionality, with the additional functionality of outputting the error code.   The socket() alternative function will execute slightly faster (after first call) due to that it uses dynamic linking instead of software interrupt to reach the @CHIP-RTOS-x86 .

See Also

RTOS API

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

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    n/an/an/aV0.90V1.00

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


End of document