mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
add listen= parameter to tcp protocol modules
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@569 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
8df72bceb5
commit
ecd346fa9a
3 changed files with 27 additions and 2 deletions
|
|
@ -334,6 +334,24 @@ pa_socket_server* pa_socket_server_new_ip_any(pa_mainloop_api *m, uint16_t port,
|
|||
return s;
|
||||
}
|
||||
|
||||
pa_socket_server* pa_socket_server_new_ip_string(pa_mainloop_api *m, const char *name, uint16_t port, const char *tcpwrap_service) {
|
||||
uint8_t ipv6[16];
|
||||
uint32_t ipv4;
|
||||
|
||||
assert(m);
|
||||
assert(name);
|
||||
assert(port > 0);
|
||||
|
||||
if (inet_pton(AF_INET6, name, ipv6) > 0)
|
||||
return pa_socket_server_new_ipv6(m, ipv6, port, tcpwrap_service);
|
||||
|
||||
if (inet_pton(AF_INET, name, &ipv4) > 0)
|
||||
return pa_socket_server_new_ipv4(m, ntohl(ipv4), port, tcpwrap_service);
|
||||
|
||||
pa_log_warn(__FILE__": failed to parse '%s'.\n", name);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void socket_server_free(pa_socket_server*s) {
|
||||
assert(s);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue