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

Function getsockname

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

* @brief Retrieves the local address of a socket. * * This function obtains the local address (IP address and port) associated with the socket 's'. * It is typically used to determine the local address and port of a bound or connected socket. * * @param s The file descriptor of the socket. * @param name A pointer to a 'sockaddr' structure that will be filled with the local address

Source from the content-addressed store, hash-verified

237 * @see getpeername() Retrieves the address of the peer connected to a socket.
238 */
239int getsockname(int s, struct sockaddr *name, socklen_t *namelen)
240{
241 int socket = dfs_net_getsocket(s);
242
243 return sal_getsockname(socket, name, namelen);
244}
245RTM_EXPORT(getsockname);
246
247/**

Callers 2

sys_getsocknameFunction · 0.85
win_getsocknameFunction · 0.85

Calls 2

dfs_net_getsocketFunction · 0.85
sal_getsocknameFunction · 0.85

Tested by

no test coverage detected