MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / bind

Function bind

components/net/sal/socket/net_sockets.c:120–125  ·  view source on GitHub ↗

* @brief Binds a socket to a specific local address and port. * * This function assigns a local address to a socket, defined by the 'name' parameter. * The address allows the socket to receive data sent to this address. * * @param s The file descriptor of the socket to bind. * @param name A pointer to a 'sockaddr' structure that specifies the address to bind to. *

Source from the content-addressed store, hash-verified

118 * @see accept() Accepts connections on a bound and listening socket.
119 */
120int bind(int s, const struct sockaddr *name, socklen_t namelen)
121{
122 int socket = dfs_net_getsocket(s);
123
124 return sal_bind(socket, name, namelen);
125}
126RTM_EXPORT(bind);
127
128/**

Callers 9

sys_bindFunction · 0.85
dhcpd_thread_entryFunction · 0.85
win_bindFunction · 0.85
tcpservFunction · 0.85
udpservFunction · 0.85
chargen_threadFunction · 0.85
udpecho_socket_entryFunction · 0.85
tcpecho_socket_entryFunction · 0.85

Calls 2

dfs_net_getsocketFunction · 0.85
sal_bindFunction · 0.85

Tested by 2

udpecho_socket_entryFunction · 0.68
tcpecho_socket_entryFunction · 0.68