Home » U++ Library support » U++ Library : Other (not classified elsewhere) » HttpClientGet problems on Linux [BUG?] 
	
		
		
			   HttpClientGet problems on Linux [BUG?] [message #3619] | 
			Wed, 07 June 2006 17:36   | 
		 
		
			
				
				
				
					
						  
						hojtsy
						 Messages: 241 Registered: January 2006  Location: Budapest, Hungary
						
					 | 
					Experienced Member  | 
					 | 
		 
		 
	 | 
 
	
		Check this code: 
String error;
String result = HttpClientGet("someserver.com/somefile.txt", NULL, &error);
if(result.IsEmpty())
  Cout << "Error: " << error << "\n";
 
Runs OK on windows, but prints this error in linux: 
Error: socket(3) / connect(someserver.com:80): Operation now in progress 
 
HttpClientGet is supposed to download the file during the call, and not return until ready or timeout, correct? 
		
		
		[Updated on: Wed, 07 June 2006 22:54] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	
		
		
			| Re: HttpClientGet problems on Linux [message #3620 is a reply to message #3619] | 
			Wed, 07 June 2006 17:59    | 
		 
		
			
				
				
				
					
						  
						hojtsy
						 Messages: 241 Registered: January 2006  Location: Budapest, Hungary
						
					 | 
					Experienced Member  | 
					 | 
		 
		 
	 | 
 
	
		On linux WSAEINPROGRESS is sent when "An operation that takes a long time to complete (such as a connect) was attempted on a non-blocking socket." I tried with blocking sockets and it works. I modified one line in HttpClient::Execute, instead of: 
if(!socket.IsOpen() && !ClientSocket(socket, sock_host, sock_port, true, NULL, 0, false)) { 
 
rather: 
if(!socket.IsOpen() && !ClientSocket(socket, sock_host, sock_port, true, NULL, 0, true)) { 
 
 
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	
		
		
			| Re: HttpClientGet problems on Linux [BUG?] [message #3623 is a reply to message #3619] | 
			Thu, 08 June 2006 07:48   | 
		 
		
			
				
				
				
					
						  
						rylek
						 Messages: 79 Registered: November 2005 
						
					 | 
					Member  | 
					 | 
		 
		 
	 | 
 
	
		Now, this is clearly an error and one that I hope to fix easily. It is not very handy to create the socket itself as blocking because it can hang the application for a long time during the connect / receive calls. The trouble is probably caused by the fact that Windows and Linux use different error codes to report an unfinished blocking operation (Windows = EWOULDBLOCK, Linux = EINPROGRESS). 
 
Regards 
 
Tomas
		
		
		
 |  
	| 
		
	 | 
 
 
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 12:58:20 CET 2025 
 Total time taken to generate the page: 0.04168 seconds 
 |