mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-25 20:16:14 -05:00
[misc] Add net_evhttp_bind() for centralizing libevent based binding
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <event2/http.h>
|
||||
|
||||
union net_sockaddr
|
||||
{
|
||||
@@ -33,12 +34,17 @@ net_address_get(char *addr, size_t addr_len, union net_sockaddr *naddr);
|
||||
int
|
||||
net_port_get(short unsigned *port, union net_sockaddr *naddr);
|
||||
|
||||
// Returns the socket fd from socket(), -1 on error
|
||||
int
|
||||
net_connect(const char *addr, unsigned short port, int type, const char *log_service_name);
|
||||
|
||||
// Returns the socket fd from socket(), -1 on error
|
||||
int
|
||||
net_bind(short unsigned *port, int type, const char *log_service_name);
|
||||
|
||||
int
|
||||
net_evhttp_bind(struct evhttp *evhttp, short unsigned port, const char *log_service_name);
|
||||
|
||||
|
||||
/* ----------------------- Conversion/hashing/sanitizers -------------------- */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user