mirror of
https://github.com/Silicondust/libhdhomerun
synced 2025-07-06 04:52:19 -07:00
20231020
This commit is contained in:
parent
bc207f273c
commit
b3153544aa
1 changed files with 8 additions and 0 deletions
|
@ -27,6 +27,7 @@ struct hdhomerun_sock_t {
|
||||||
long events_selected;
|
long events_selected;
|
||||||
int af;
|
int af;
|
||||||
uint8_t ttl_set;
|
uint8_t ttl_set;
|
||||||
|
bool shutdown;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool hdhomerun_local_ip_info2(int af, hdhomerun_local_ip_info2_callback_t callback, void *callback_arg)
|
bool hdhomerun_local_ip_info2(int af, hdhomerun_local_ip_info2_callback_t callback, void *callback_arg)
|
||||||
|
@ -181,7 +182,9 @@ void hdhomerun_sock_destroy(struct hdhomerun_sock_t *sock)
|
||||||
|
|
||||||
void hdhomerun_sock_stop(struct hdhomerun_sock_t *sock)
|
void hdhomerun_sock_stop(struct hdhomerun_sock_t *sock)
|
||||||
{
|
{
|
||||||
|
sock->shutdown = true;
|
||||||
shutdown(sock->sock, SD_BOTH);
|
shutdown(sock->sock, SD_BOTH);
|
||||||
|
SetEvent(sock->event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void hdhomerun_sock_set_send_buffer_size(struct hdhomerun_sock_t *sock, size_t size)
|
void hdhomerun_sock_set_send_buffer_size(struct hdhomerun_sock_t *sock, size_t size)
|
||||||
|
@ -373,6 +376,11 @@ static bool hdhomerun_sock_event_select(struct hdhomerun_sock_t *sock, long even
|
||||||
}
|
}
|
||||||
|
|
||||||
ResetEvent(sock->event);
|
ResetEvent(sock->event);
|
||||||
|
|
||||||
|
if (sock->shutdown) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue