同时/异步URL请求和响应 [英] Simultaneous/Asynchronous URL Requests and Response

查看:104
本文介绍了同时/异步URL请求和响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想测试在Webserver中运行的应用程序的负载处理能力和响应时间。所以我正在写一个MFC应用程序。在该应用程序中,我希望从多个线程连续同时向Webserver发出请求。
请求将在另一个线程中收到。现在使用
CInternetSession :: OpenURL()函数实现并发送请求。但问题是,前4个请求是连续发送的,然后对于第5个请求,OpenURL()将等待已发送4个请求的完成。然后,无法同时发送
的请求。请求正在发送,OpenURL()API需要很长时间才能响应(返回)。



我已将选项设置为 INTERNET_OPTION_MAX_CONNS_PER_SERVER 15和
INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER 为15,用于提供多个请求。



我的最终目标是在一个线程中异步发送请求并在另一个线程中异步接收它。



是否有任何其他库或方法用于在Windows中异步发送请求和接收请求。请帮助。



服务器 - Windows Server 2008 R2,操作系统是Windows 7,开发平台:MFC





问候,$! J @'$

解决方案

http://stackoverflow.com/questions/12650238/processing-simultaneous-asynchronous-requests-with-python-basehttpserver

I want to test the load handling capacity and response time of a application running in Webserver. So for that i am writing an MFC application. In that application i want to the simultaneous requests to Webserver continuously from multiple threads. The requests will be received in another threads. Now implemented and sent the request by using CInternetSession::OpenURL () function. But the problem is, first 4 requests are send continuously and then the for the 5th request the OpenURL() will wait for the completion of the already send 4 requests. Then onwards, the simultaneous sending of the request is not possible. Request is sending and the OpenURL() API is taking long time to respond (return back).

I have set the option as INTERNET_OPTION_MAX_CONNS_PER_SERVER as 15 and INTERNET_OPTION_MAX_CONNS_PER_1_0_SERVER as 15 for giving multiple request.

My ultimate aim is to send the request asynchronously in one thread and receive it asynchronously in another thread.

is there is any other library or method for sending the request and receiving the request asynchronously in Windows. Please help.

Server - Windows Server 2008 R2, OS is Windows 7, Development Platform: MFC


Regards, $ ! J @' $

解决方案

http://stackoverflow.com/questions/12650238/processing-simultaneous-asynchronous-requests-with-python-basehttpserver


这篇关于同时/异步URL请求和响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆