socket Function

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
socket Function
C
SOCKET socket(
    int af, 
    int type, 
    int protocol
);
Description

This function creates a new BSD socket for the microchip TCPIP stack. The return socket descriptor is used for the subsequent BSD operations.

Preconditions

BerkeleySocketInit function should be called.

Parameters
Parameters 
Description 
af 
address family - AF_INET
type 
socket type SOCK_DGRAM or SOCK_STREAM
protocol 
IP protocol IPPROTO_UDP or IPPROTO_TCP
Returns

New socket descriptor. INVALID_SOCKET in case of error.

Remarks

None.

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.