fix for Windows (#69)
* fix for Windows * fix condition * make condition only on Windows
This commit is contained in:
		
				
					committed by
					
						
						Benjamin Sergeant
					
				
			
			
				
	
			
			
			
						parent
						
							d8dc977fc1
						
					
				
				
					commit
					22a806ca6f
				
			@@ -73,7 +73,7 @@ namespace ix
 | 
			
		||||
 | 
			
		||||
        struct timeval timeout;
 | 
			
		||||
        timeout.tv_sec = timeoutMs / 1000;
 | 
			
		||||
        timeout.tv_usec = (timeoutMs < 1000) ? 0 : 1000 * (timeoutMs % 1000);
 | 
			
		||||
        timeout.tv_usec = 1000 * (timeoutMs % 1000);
 | 
			
		||||
 | 
			
		||||
        // Compute the highest fd.
 | 
			
		||||
        int sockfd = _sockfd;
 | 
			
		||||
 
 | 
			
		||||
@@ -223,7 +223,6 @@ namespace ix
 | 
			
		||||
 | 
			
		||||
        uint32_t retries = 0;
 | 
			
		||||
        millis duration;
 | 
			
		||||
        ix::WebSocketInitResult status;
 | 
			
		||||
 | 
			
		||||
        // Try to connect perpertually
 | 
			
		||||
        while (true)
 | 
			
		||||
@@ -249,7 +248,7 @@ namespace ix
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // Try to connect synchronously
 | 
			
		||||
            status = connect(_handshakeTimeoutSecs);
 | 
			
		||||
            ix::WebSocketInitResult status = connect(_handshakeTimeoutSecs);
 | 
			
		||||
 | 
			
		||||
            if (!status.success)
 | 
			
		||||
            {
 | 
			
		||||
 
 | 
			
		||||
@@ -303,6 +303,10 @@ namespace ix
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
#ifdef _WIN32
 | 
			
		||||
        if (lastingTimeoutDelayInMs <= 0) lastingTimeoutDelayInMs = 20;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
        // poll the socket
 | 
			
		||||
        PollResultType pollResult = _socket->poll(lastingTimeoutDelayInMs);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user