forked from osmocom/wireshark
androiddump: Set connect socket to non-blocking on Windows
Bug: 13104 Change-Id: I05248dad8e72272cf0933c766ec0bf5160075e1e Reviewed-on: https://code.wireshark.org/review/20275 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
parent
3cc899a428
commit
043ed1f6b3
|
@ -279,9 +279,13 @@ static void useNonBlockingConnectTimeout(socket_handle_t sock) {
|
|||
int res_rcv;
|
||||
#ifdef _WIN32
|
||||
const DWORD socket_timeout = SOCKET_RW_TIMEOUT_MS;
|
||||
unsigned long non_blocking = 1;
|
||||
|
||||
res_snd = setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (const char *) &socket_timeout, sizeof(socket_timeout));
|
||||
res_rcv = setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (const char *) &socket_timeout, sizeof(socket_timeout));
|
||||
|
||||
/* set socket to non-blocking */
|
||||
ioctlsocket(sock, FIONBIO, &non_blocking);
|
||||
#else
|
||||
const struct timeval socket_timeout = {
|
||||
.tv_sec = SOCKET_RW_TIMEOUT_MS / 1000,
|
||||
|
|
Loading…
Reference in New Issue