sockaddr_to_string2

March 26, 2020 Contributors

Name

sockaddr_to_string2 — Renders a socket address into human-readable form

Synopsis

#include "netlistener.h"

| int **sockaddr_to_string2** ( | sa, |   |
|   | buffer, |   |
|   | buf_size); |   |

struct sockaddr * <var class="pdparam">sa</var>;
char * <var class="pdparam">buffer</var>;
int <var class="pdparam">buf_size</var>;

Description

Renders the socket address to human-readable form. Uses the provided buffer to render the socket address to a string.

Parameters

sa

The socket address.

buffer

The target for the human-readable form of the socket address.

Warning

This must not be NULL.

buf_size

The buffer length, in bytes.

Return Values

Returns the length of the rendered form of the socket address.

Threading

It is legal to call this function in any thread.

See Also

sockaddr_to_string