aboutsummaryrefslogtreecommitdiff
path: root/sockutils.h
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2018-03-30 12:35:05 -0700
committerGuy Harris <guy@alum.mit.edu>2018-03-30 12:35:05 -0700
commit5206cd9ec988dcde67c11d6e5311286d5b488801 (patch)
tree9902fad433c9f577237edb93e4e198ecf9c02ae4 /sockutils.h
parentda2f88d1a1fa137a98c35aab6416a0622ae3ffd1 (diff)
Redo the main event loop of rpcapd.
Have the main thread wait on all of the sockets on which we're listening, using select() on UN*X and WSAWaitForMultipleEvents() on Windows, rather than having separate threads or processes for each of the sockets. On UN*X, have "shut down" signals just set a flag, and have the select() check for EINTR and, if it got EINTR, check the flag, and leave the main event loop if it's set. On Windows, set a console control event handler and, for all the "shut down" events, set an event on which the main thread waits, in addition to the socket events, and, if that event is signaled, leave the main event loop.
Diffstat (limited to 'sockutils.h')
-rw-r--r--sockutils.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sockutils.h b/sockutils.h
index 95dfb461..642ec43b 100644
--- a/sockutils.h
+++ b/sockutils.h
@@ -196,7 +196,7 @@ extern "C" {
int sock_init(char *errbuf, int errbuflen);
void sock_cleanup(void);
-/* It is 'public' because there are calls (like accept() ) which are not managed from inside the sockutils files */
+void sock_fmterror(const char *caller, int errcode, char *errbuf, int errbuflen);
void sock_geterror(const char *caller, char *errbuf, int errbufsize);
int sock_initaddress(const char *address, const char *port,
struct addrinfo *hints, struct addrinfo **addrinfo,