www.beck-ipc.com

@CHIP-RTOS C Library - TCP/IP API


socket

Create a socket.

int far socket ( int family,
                   int type,
                   int protocol ) ;

Parameters

family

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

type

SOCK_STREAM (=1) : Stream based socket
SOCK_DGRAM (=2) : Datagram based socket

protocol

IPPROTO_TCP (=6) :   TCP socket
IPPROTO_UDP (=17) :   UDP socket

Return Value

-1: Failure, error code is available using get_socketerror(-1)
otherwise:   New socket descriptor

Comments

Creates an endpoint for communication and returns a socket descriptor.   This function provides the BSD socket functionality.

See Also

RTOS API

On the first call, this library function invokes a software interrupt which modifies the code at the calling site inside your application program.   A direct FAR JMP into the @CHIP-RTOS-x86 implementation for this function is installed so that on return and on any subsequent calls to this API this dynamic link reaches the function's implementation directly.

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    n/an/an/aV1.36V1.36

Supported by @CHIP-RTOS C Library since version

    CLIB
    V2.20

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


End of document