www.beck-ipc.com

@CHIP-RTOS C Library - TCP/IP API


opensocket

Open a socket.

int opensocket ( unsigned char type, int *error );

Parameters

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 function provides functionality similar to the BSD socket() function.

SC1x3/SC2x Comments

This function applies only to IPv4 sockets.   Either the opensocket_ext legacy API or the BSD compatible socket API may be used to open IPv4 or IPv6 sockets.

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
    V1.00V1.00V1.00V0.90V1.00

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


End of document