Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
| Search | Today's Posts | Mark Forums Read
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 4th, 2005, 03:25 AM
Registered User
 
Join Date: May 2005
Location: Kyiv, , Ukraine.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to MereMortal
Default Multiple http-requests are stuck

Hi all!

I have a problem with multiple tcp (http) connections on Windows. When my program sent many (says, 300 http-connections. The critical number of http-connections depends on speed of Internet connection) http-requests, part of them are stuck. That means, request is sent, but response is either received partly or not received at all. At that, a stuck connection isn’t dropped by web server.

This problem is present only in the Internet. There is no such problem on local machine. Based on experiment, the problem doesn’t depend on either my application sends all 300 requests to single web server or my app sends requests, says, to 6 servers by 50 requests to each server. The result is the same: some of connections are stuck for a long time.

I made a small program to investigate this problem. The program sends http-requests and receives http-response. The program creates the thread for each connection. There is opportunity to set timeout between creating connections. By default, there is no timeout and all connections are created at the same time. When I was playing with this app, I found that if I set the timeout (10-100 millisecond), http-requests worked more effectively. Sometimes, if to choose the right timeout, there are no stuck and the app uses almost all available bandwidth.

Can somebody write what’s the problem? Why are requests are stuck? What’s the cause? I could send the test app with source codes (c++) by request.

Thanks!

--
  Vadim


Reply With Quote
  #2 (permalink)  
Old May 5th, 2005, 12:52 AM
Authorized User
 
Join Date: Mar 2005
Location: Wagga Wagga, NSW, Australia.
Posts: 58
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to Alan-LB Send a message via Yahoo to Alan-LB
Default

Cant help you without you showing some of the relevant code. Post the code and tell us what you were trying to do step by step.

Alan

Reply With Quote
  #3 (permalink)  
Old May 9th, 2005, 03:46 PM
Registered User
 
Join Date: May 2005
Location: Kyiv, , Ukraine.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to MereMortal
Default

I'm sorry for the late reply.

http://www.sachenko.com/rchhc/HTTPTest.zip - this is source and binary of the application, described by me.

The task is very simple: to open several hundred of simultaneous http-connections, send requests and receive responses.

But there is a problem. Some of connections are stuck. Connection is present, but no data to receive for a long time.

Reply With Quote


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Concurrent Requests to XmlHttpRequest deepak.vasudevan Ajax 3 March 22nd, 2006 04:56 AM
Multiple Concurrent Requests to XmlHttpRequest deepak.vasudevan Javascript 0 November 14th, 2005 06:49 AM
My Thanks and Requests!!! mehdi62b Forum and Wrox.com Feedback 0 September 3rd, 2004 04:50 PM
Multiple simultaneous asynchronous requests mehdi62b ASP.NET 1.0 and 1.1 Professional 18 August 25th, 2004 04:18 PM
Single HTTP POST - Multiple XML docs denniswong288 XML 1 August 26th, 2003 05:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.