bind Function

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
bind Function
C
int bind(
    SOCKET s, 
    const struct sockaddr* name, 
    int namelen
);
Description

The bind function assigns a name to an unnamed socket. The name represents the local address of the communication endpoint. For sockets of type SOCK_STREAM, the name of the remote endpoint is assigned when a connect or accept function is executed.

Preconditions

socket function should be called.

Parameters
Parameters 
Description 
Socket descriptor returned from a previous call to socket. 
name 
pointer to the sockaddr structure containing the local address of the socket. 
namelen 
length of the sockaddr structure. 
Returns

If bind is successful, a value of 0 is returned. A return value of SOCKET_ERROR indicates an error.

Remarks

None.

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