add switch_socket_waitlist for waiting on multiple sockets and abstract it to poll and select so windows can use it too

This commit is contained in:
Anthony Minessale
2014-07-25 00:23:08 +05:00
parent bd804df7a3
commit 4f1b09a3ca
4 changed files with 261 additions and 46 deletions
+7
View File
@@ -2398,6 +2398,13 @@ typedef enum {
SWITCH_POLL_INVALID = (1 << 7)
} switch_poll_t;
typedef struct switch_waitlist_s {
switch_os_socket_t sock;
uint32_t events;
uint32_t revents;
} switch_waitlist_t;
SWITCH_END_EXTERN_C
#endif
/* For Emacs:
+2
View File
@@ -1067,6 +1067,8 @@ SWITCH_DECLARE(unsigned long) switch_atoul(const char *nptr);
*/
SWITCH_DECLARE(char *) switch_strerror_r(int errnum, char *buf, switch_size_t buflen);
SWITCH_DECLARE(int) switch_wait_sock(switch_os_socket_t sock, uint32_t ms, switch_poll_t flags);
SWITCH_DECLARE(int) switch_wait_socklist(switch_waitlist_t *waitlist, uint32_t len, uint32_t ms);
SWITCH_END_EXTERN_C
#endif
/* For Emacs: