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

Function getpeername

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

* @brief Retrieves the address of the peer connected to a socket. * * This function obtains the address of the peer (remote end) connected to the socket 's'. * It is typically used on connected sockets (e.g., TCP) to retrieve information about the peer. * * @param s The file descriptor of the connected socket. * @param name A pointer to a 'sockaddr' structure that will be filled w

Source from the content-addressed store, hash-verified

206 * @see getsockname() Retrieves the local address of a socket.
207 */
208int getpeername(int s, struct sockaddr *name, socklen_t *namelen)
209{
210 int socket = dfs_net_getsocket(s);
211
212 return sal_getpeername(socket, name, namelen);
213}
214RTM_EXPORT(getpeername);
215
216/**

Callers 2

sys_getpeernameFunction · 0.85
win_getpeernameFunction · 0.85

Calls 2

dfs_net_getsocketFunction · 0.85
sal_getpeernameFunction · 0.85

Tested by

no test coverage detected