sockaddr_to_string
Name
sockaddr_to_string — Renders a socket address into human-readable form
Synopsis
#include "netlistener.h"
| char * **sockaddr_to_string** (
| sa, | |
| | buffer, | |
| | len)
; | |
struct sockaddr * <var class="pdparam">sa</var>
;
char * <var class="pdparam">buffer</var>
;
int * <var class="pdparam">len</var>
;
Description
Renders a socket address into human-readable form.
Note
You may find that sockaddr_to_string2 is slightly easier to use.
- sa
-
The socket address.
- buffer
-
The target for the human-readable form of the socket address.
Note
If the
buffer
isNULL
on input, then a static, thread-unsafe buffer will be used and returned. - len
-
The buffer length.
Note
*l
must store thebuffer
size. As as side effect,*l
will be updated with the length of the rendered string.
Returns the buffer that was used for rendering the socket address.
It is legal to call this function in any thread.