pion-users Mailing List for Pion Network Library
client and server HTTP(S) library for Boost C++ developers
Brought to you by:
mikedickey
You can subscribe to this list here.
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2013 |
Jan
(3) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
|
Dec
(5) |
| 2014 |
Jan
|
Feb
|
Mar
(6) |
Apr
(4) |
May
(4) |
Jun
(5) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(2) |
| 2015 |
Jan
(5) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Neel B. <nee...@gm...> - 2016-08-25 17:14:09
|
Till Fedora 23 pion can be installed via dnf, However in Fedora 24 no pion package is available. |
|
From: Robert L. <rob...@se...> - 2016-08-25 10:41:15
|
hi everyone, I had a look at this compilation error (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811849), and managed to reduce the problem to a much smaller case: ----------------------------8<------------------------------ #include <boost/bind.hpp> #include <boost/shared_ptr.hpp> #include <boost/core/noncopyable.hpp> #include <boost/function.hpp> // fails to compile with g++-6 in a manner similar to // https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811849 // works with g++-5 class argument { }; class test : private boost::noncopyable { public: void member(void); // note that the shared_ptr is passed by reference! is passing a // shared_ptr by reference even safe? it so, does it not need to // be // const? void callback(boost::shared_ptr<argument>& cb); }; // but that this declaration is without the reference! putting it in // makes it // work in g++-6 as well, but see above about the question whether this // is safe typedef boost::function1<void, boost::shared_ptr<argument> > callback_type; void recipient(callback_type cb) { } void test::member(void) { recipient(boost::bind(&test::callback, this, _1)); } ---------------------------->8------------------------------ to me it seems that the problem is that the shared_ptr is passed to the callback by reference, which seems to be different from the callback type expectations, and which sounds like a dangerous way to use a shared_ptr anyway, at least to me. for kicks I modified finish_connection() in pion::tcp::server to take a non-reference argument, and that makes this particular class compile with g++-6. there are similar cases in http::server which can be made to compile the same way, but which also raises the question why this usage of a shared_ptr is a problem for connection_ptr, but nor request_ptr. there appear to be other compilation problems, but one at a time... regards robert -- Robert Lemmen http://www.semistable.com |
|
From: matus u. <mat...@gm...> - 2016-07-21 12:40:53
|
Hello all, I started to test communication via https protocol with a bunch of video players (HLS protocol), and I'm catching quite often the BOOST_ASSERT(! eof() ); in http_parser.cpp L58. I never did catch this one if comm. via http protocol. Is there any particular reason to have BOOST_ASSERT calls, especially this one, in production? :) We could leave the resolution to handler, which would be called with the appropriate error code, before the parse call in http_reader.cpp L77. Best Regards, Matus |
|
From: Leo L. <le...@ho...> - 2016-05-03 20:20:57
|
Hi all, I am new to Pion-net and boost/asio and recently take on a project that will utilize Pion for constructing https server/client. With Pion, HTTPS server and HTTP client is coded with ease. However, I am not able to find how to use Pion to construct an HTTPS client. I do have some example in HTTPS client with asio directly. I am wondering if anyone can share an example of how to code SSL handshake with Pion tcp connection class. Any help or suggestion would be greatly appreciated. Thanks,Leo |
|
From: David S. <ca...@gm...> - 2015-10-30 17:20:10
|
I would be willing. -- David On Fri, Oct 30, 2015 at 10:35 AM, Mike Dickey <md...@sp...> wrote: > Hi all, > > It seems that I stopped getting github notifications a year or so ago.. > Need to try figuring that out. > > I’ll try catching up on the pull requests soon. I was hoping that Splunk’s > stream engineering team would take this over, but that doesn’t seem to have > worked out so well. If anyone out there is interested in taking a more > active management role of this project, please let me know as given my very > limited availability these days it may be time to pass the ball. > > Regards, > -Mike > > From: Roger Martin <ro...@qu...> > Date: Monday, October 12, 2015 at 2:57 PM > To: "pio...@li..." <pio...@li...> > Subject: Re: [pion-users] Pull Request #92. Any activity? > > Hi, > > I pinged Michael Dickey on two email addresses I had to try to contact > him. Pion needs to continue and the developers need to get together a bit. > Pion is running strong for me > > On 10/12/2015 03:57 PM, David Sankel wrote: > > Hello all, > > Pull request #92 has been outstanding since July with no comments and it > seems like a pretty straightforward merge. Would anyone be willing to > review it and, if it looks okay, merge it in? > > Thanks, > > David Sankel > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > pion-users mailing lis...@li...://lists.sourceforge.net/lists/listinfo/pion-users > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > pion-users mailing list > pio...@li... > https://lists.sourceforge.net/lists/listinfo/pion-users > > |
|
From: Mike D. <md...@sp...> - 2015-10-30 16:51:28
|
Hi all, It seems that I stopped getting github notifications a year or so ago.. Need to try figuring that out. I’ll try catching up on the pull requests soon. I was hoping that Splunk’s stream engineering team would take this over, but that doesn’t seem to have worked out so well. If anyone out there is interested in taking a more active management role of this project, please let me know as given my very limited availability these days it may be time to pass the ball. Regards, -Mike From: Roger Martin <ro...@qu...<mailto:ro...@qu...>> Date: Monday, October 12, 2015 at 2:57 PM To: "pio...@li...<mailto:pio...@li...>" <pio...@li...<mailto:pio...@li...>> Subject: Re: [pion-users] Pull Request #92. Any activity? Hi, I pinged Michael Dickey on two email addresses I had to try to contact him. Pion needs to continue and the developers need to get together a bit. Pion is running strong for me On 10/12/2015 03:57 PM, David Sankel wrote: Hello all, Pull request #92 has been outstanding since July with no comments and it seems like a pretty straightforward merge. Would anyone be willing to review it and, if it looks okay, merge it in? Thanks, David Sankel ------------------------------------------------------------------------------ _______________________________________________ pion-users mailing list pio...@li...<mailto:pio...@li...>https://lists.sourceforge.net/lists/listinfo/pion-users |
|
From: Roger M. <ro...@qu...> - 2015-10-12 22:16:45
|
Hi, I pinged Michael Dickey on two email addresses I had to try to contact him. Pion needs to continue and the developers need to get together a bit. Pion is running strong for me On 10/12/2015 03:57 PM, David Sankel wrote: > Hello all, > > Pull request #92 has been outstanding since July with no comments and > it seems like a pretty straightforward merge. Would anyone be willing > to review it and, if it looks okay, merge it in? > > Thanks, > > David Sankel > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > pion-users mailing list > pio...@li... > https://lists.sourceforge.net/lists/listinfo/pion-users |
|
From: David S. <ca...@gm...> - 2015-10-12 19:58:02
|
Hello all, Pull request #92 has been outstanding since July with no comments and it seems like a pretty straightforward merge. Would anyone be willing to review it and, if it looks okay, merge it in? Thanks, David Sankel |
|
From: Sergei N. <ser...@gm...> - 2015-10-09 14:37:39
|
2015-10-09 9:31 GMT+03:00 Neel Basu <nee...@gm...>: > I am trying to read a application/octet-stream of content size > 200MB with > pion net synchronously. But What I get is only 1.0MB downloaded. > It's limited with DEFAULT_CONTENT_MAX constant by default. So it's by design. Check set_max_content_length() API to change default behavior. -- Best Regards, Sergei Nikulov |
|
From: Neel B. <nee...@gm...> - 2015-10-09 06:31:51
|
I am trying to read a application/octet-stream of content size > 200MB with
pion net synchronously. But What I get is only 1.0MB downloaded.
std::string image_stream_name =
(boost::format("/var/lib/hc/images/%1%.%2%.hc") % image_id %
instance_id).str();
pion::net::TCPConnectionPtr client_connection(new
pion::net::TCPConnection(_service));
client_connection->setLifecycle(pion::net::TCPConnection::LIFECYCLE_KEEPALIVE);
pion::net::HTTPRequest client_request;
client_request.setMethod("GET");
client_request.setResource((boost::format("/v2/images/%1%/file") %
image_id).str());
boost::system::error_code ec;
ec = client_connection->connect("localhost",
_config.glance().endpoint.port);
if(!ec){
client_request.send(*(client_connection.get()), ec);
if(!ec){
pion::net::HTTPResponse client_response(client_request);
client_response.receive(*client_connection.get(), ec);
if(!ec){
std::ofstream image_stream;
image_stream.open(image_stream_name.c_str());
std::cout << "downloading image into " << image_stream_name <<
std::endl;
std::cout << "image size: " << client_response.getContentLength() <<
" chunked: " << client_response.isChunked() << std::endl;
client_response.write(image_stream, ec);
}
}
}
This same works if response size is smaller. However it is not working for
larger responses.
returned response content length is wrong. in chrome I see
Content-Length:228599296
image size: 1048576 chunked: 0
|
|
From: Mike D. <md...@sp...> - 2015-06-10 21:44:36
|
Not that I am aware of. I’m unable to help with this, but please feel free to submit a pull request via github. Thanks, -Mike On 6/3/15, 8:04 AM, "Martin Meeser" <mar...@in...> wrote: >Hello Mike, and all Others > >are there any plans on upgrading to HTTP/2 ? > > >I might be able to contribute. > > > >Regards >Martin > >-- ><hr/> ><b>Martin Meeser</b> freiberuflicher Diplom Informatiker >(Universität)<br/> >Hainstraße 22<br/> >65582 Diez<br/> ><br/> >Tel: +49 (0)176 201 12 817<br/> >Email: mar...@in...<br/> >Steuer-Nr: 14/221/13688<br/><br/> > >www.softwareing.de > |
|
From: Alex <al...@st...> - 2015-06-08 18:47:54
|
Hi Roger, On 06/08/2015 07:12 PM, Roger Martin wrote: > Hi Alex, > > Excellent! I'll be trying it along with the new asio. > > What was done for the threading? All c++11 threading using #include > <thread> and friends? Yes, C++11 <thread>, <mutex> and <condition_variable> are used instead of their Boost counterparts. > > > On 06/05/2015 12:58 PM, Alex wrote: >> Hi Pion developers, >> >> Just for your information, I ported a subset of Pion HTTP server to >> standalone ASIO so it can be used without Boost - >> https://github.com/staticlibs/staticlib_httpserver >> >> I tried to keep code logic untouched, the only notable addition is a >> streaming_server extension that allows to receive uploaded files of >> arbitrary size. Besides this (and besides removed functionality) changes >> are mostly cosmetic - reformatted doxygen comments, moved some inline >> methods to cpp files etc. >> >> Result library compiles fine for Windows (MSVS 2013), Linux (GCC 4.7+), >> Mac OS (Clang 3.4+), iOS, Android and Raspberry. >> >> PS: If I referenced a copyright of Pion project in wrong way - please >> let me know, I will try to fix it. >> > > > ------------------------------------------------------------------------------ > _______________________________________________ > pion-users mailing list > pio...@li... > https://lists.sourceforge.net/lists/listinfo/pion-users > -- -Alex |
|
From: Roger M. <ro...@qu...> - 2015-06-08 18:31:45
|
Hi Alex, Excellent! I'll be trying it along with the new asio. What was done for the threading? All c++11 threading using #include <thread> and friends? On 06/05/2015 12:58 PM, Alex wrote: > Hi Pion developers, > > Just for your information, I ported a subset of Pion HTTP server to > standalone ASIO so it can be used without Boost - > https://github.com/staticlibs/staticlib_httpserver > > I tried to keep code logic untouched, the only notable addition is a > streaming_server extension that allows to receive uploaded files of > arbitrary size. Besides this (and besides removed functionality) changes > are mostly cosmetic - reformatted doxygen comments, moved some inline > methods to cpp files etc. > > Result library compiles fine for Windows (MSVS 2013), Linux (GCC 4.7+), > Mac OS (Clang 3.4+), iOS, Android and Raspberry. > > PS: If I referenced a copyright of Pion project in wrong way - please > let me know, I will try to fix it. > |
|
From: Alex <al...@st...> - 2015-06-05 17:12:32
|
Hi Pion developers, Just for your information, I ported a subset of Pion HTTP server to standalone ASIO so it can be used without Boost - https://github.com/staticlibs/staticlib_httpserver I tried to keep code logic untouched, the only notable addition is a streaming_server extension that allows to receive uploaded files of arbitrary size. Besides this (and besides removed functionality) changes are mostly cosmetic - reformatted doxygen comments, moved some inline methods to cpp files etc. Result library compiles fine for Windows (MSVS 2013), Linux (GCC 4.7+), Mac OS (Clang 3.4+), iOS, Android and Raspberry. PS: If I referenced a copyright of Pion project in wrong way - please let me know, I will try to fix it. -- -Alex |
|
From: Martin M. <mar...@in...> - 2015-06-03 15:22:27
|
Hello Mike, and all Others are there any plans on upgrading to HTTP/2 ? I might be able to contribute. Regards Martin -- <hr/> <b>Martin Meeser</b> freiberuflicher Diplom Informatiker (Universität)<br/> Hainstraße 22<br/> 65582 Diez<br/> <br/> Tel: +49 (0)176 201 12 817<br/> Email: mar...@in...<br/> Steuer-Nr: 14/221/13688<br/><br/> www.softwareing.de |
|
From: Mike D. <md...@sp...> - 2015-02-02 23:32:35
|
That’s a good catch, David. It probably should set ec if one of the out.write() calls fail (by checking the state flag): http://www.cplusplus.com/reference/ostream/ostream/write/ -Mike From: David Sankel Date: Monday, February 2, 2015 at 3:26 PM To: "pio...@li...<mailto:pio...@li...>" Subject: [pion-users] pion::http::message::write Hello all, I noticed that the 'ec' parameter of the 'write' function in 'pion::http::message' is unused. Would it be better to remove this parameter or document that it is unused? I can make a patch for whichever option seems better. Thanks in advance, David Sankel |
|
From: David S. <ca...@gm...> - 2015-02-02 23:26:43
|
Hello all, I noticed that the 'ec' parameter of the 'write' function in 'pion::http::message' is unused. Would it be better to remove this parameter or document that it is unused? I can make a patch for whichever option seems better. Thanks in advance, David Sankel |
|
From: Sergei N. <ser...@gm...> - 2015-01-13 13:36:18
|
Added pion-users list. ---------- Forwarded message ---------- From: Sergei Nikulov <ser...@gm...> Date: 2015-01-13 16:34 GMT+03:00 Subject: Re: [pion-users] CMake Issues on Windows To: Azareal - <inv...@li...> Hello, 2015-01-01 0:05 GMT+03:00 Azareal - <inv...@li...>: > > > *Hello,* > > *Which version of cmake do you using?* > > > *AFAIK, version 3.0.2 has "1.56.0" as latest in FindBoost.cmake.* > > *Could you please add additional option > -DBoost_ADDITIONAL_VERSIONS="1.57.0" to cmake invocation command and try > again?* > That didn't seem to work, although Pion seems to build perfectly fine when > I use Boost 1.56.0 instead of 1.57.0. > > Sorry for delay. This works for me: cmake .. -G"Visual Studio 11 Win64" -DBoost_ADDITIONAL_VERSIONS="1.57.0;1.57" -DBOOST_ROOT=C:\DEV64\boost Boost was installed as per following gist https://gist.github.com/snikulov/4037650 CMake v3.1.0 Console output: CMAKE_CXX_COMPILER_VERSION = 17.0.61030.0 >>> Building Pion version: 5.0.7 >>> EXECUTABLE_OUTPUT_PATH = C:/WORK/GITHUB/pion/b/Bin/ -- Looking for include file pthread.h -- Looking for include file pthread.h - not found -- Found Threads: TRUE -- Boost version: 1.57.0 -- Found the following Boost libraries: -- thread -- system -- filesystem -- regex -- unit_test_framework -- Looking for C++ include unordered_map -- Looking for C++ include unordered_map - found -- Looking for malloc_trim -- Looking for malloc_trim - not found -- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) -- Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR) -- Found OpenSSL: C:/DEV64/openssl/lib/ssleay32.lib;C:/DEV64/openssl/lib/libeay32.lib (found version "1.0.1i") -- Found Doxygen: C:/Program Files/doxygen/bin/doxygen.exe (found version "1.8.8") BUILD_ALLOWNOTHINGSERVICE = ON BUILD_COOKIESERVICE = ON BUILD_ECHOSERVICE = ON BUILD_FILESERVICE = ON BUILD_HELLOSERVICE = ON BUILD_LOGSERVICE = ON BUILD_PIOND = ON BUILD_HELLOSERVER = ON -- Configuring done -- Generating done -- Build files have been written to: C:/WORK/GITHUB/pion/b -- HTH. Best Regards, Sergei Nikulov -- Best Regards, Sergei Nikulov |
|
From: Rohan S. <she...@ya...> - 2015-01-12 03:04:37
|
Hi Mike,
Thanks for the solution. I do appreciate your help
Regards,Rohan
From: Mike Dickey <md...@sp...>
To: Rohan Shetty <she...@ya...>; "pio...@li..." <pio...@li...>
Sent: Saturday, January 10, 2015 10:03 PM
Subject: Re: [pion-users] How to increase the the "concurrent processing threads" in pion - Handle leak
That approach sounds right to me. Use the handler to just spawn off your long-running job, cache the parameters in the job (in particular keeping the tcp conn pointer alive will keep the connection open), and return right away. Then when the job is finished, use response_writer to schedule an async response to the request.
-Mike
From: Rohan Shetty <she...@ya...>
Reply-To: Rohan Shetty <she...@ya...>
Date: Friday, January 9, 2015 at 9:40 PM
To: Microsoft Office User <md...@sp...>, "pio...@li..." <pio...@li...>
Subject: Re: [pion-users] How to increase the the "concurrent processing threads" in pion - Handle leak
Hi Mike,
Thanks for the detailed response.
In my case, I have a blocking handler. I guess every blocking handler consumes a thread. Please correct if my understanding is not right. I would appreciate if you suggest a solution(or a work around).
e.g. would the following work?- In the handler, I would store the variables (PtrHttpRequest, PtrTcpConn). And without sending the response, I would return from the handler.- I will use a thread, which would make use of the above variables(PtrHttpRequest, PtrTcpConn), and send the response.Would the above approach consume a pion thread?
Any help is appreciated.
Regards,
Rohan
From: Mike Dickey <md...@sp...>
To: Rohan Shetty <she...@ya...>; "pio...@li..." <pio...@li...>
Sent: Friday, January 9, 2015 10:37 PM
Subject: Re: [pion-users] How to increase the the "concurrent processing threads" in pion - Handle leak
Pion is asynchronous, so 8 threads should be able to handle many thousands of concurrent connections. Unless you have some sort of blocking code in your handler, there is probably no reason to increase it beyond the number of physical cores (8 threads should fully utilize 8 physical cores).
From: Rohan Shetty <she...@ya...>
Reply-To: Rohan Shetty <she...@ya...>
Date: Thursday, January 8, 2015 at 9:30 PM
To: "pio...@li..." <pio...@li...>
Subject: [pion-users] How to increase the the "concurrent processing threads" in pion - Handle leak
Hi,
I use the following code, which is working fine
pion::http::server_ptrm_HttpServer;unsigned int m_iPort = 0
//Listen only in the loopback interfaceboost::asio::ip::address addr(boost::asio::ip::address_v4::loopback());
// If port =0, then the HttpServer would take a free available portboost::asio::ip::tcp::endpoint endpoint(addr, m_iPort);
// Create a web server and specify the port on which it will listen. m_HttpServer = pion::http::server_ptr(new pion::http::server(endpoint));
m_HttpServer->start();
Following is the handler used for testing this.
void CPalHttpServer::RequestHandlerForPalRoot(constrequest_ptr & PtrHttpRequest, connection_ptr & PtrTcpConn){string HELLO_HTML = "<html><body>PAL Service!</body></html>";
response_writer_ptr writer(response_writer::create(PtrTcpConn, * PtrHttpRequest, boost::bind(&connection::finish, PtrTcpConn)));
writer->write(HELLO_HTML);
writer->send()}
By default PION supports around 8 threads, which will limit only 8 concurrent HTTP requests.
I tried the following code, in which I have tried to increasing the thread to 100. Is this the right ?
pion::http::server_ptrm_HttpServer;pion::single_service_scheduler m_DefaultScheduler;m_DefaultScheduler.set_num_threads(100);unsigned int m_iPort = 0
//Listen only in the loopback interfaceboost::asio::ip::address addr(boost::asio::ip::address_v4::loopback());
// If port =0, then the HttpServer would take a free available portboost::asio::ip::tcp::endpoint endpoint(addr, m_iPort);
// Create a web server and specify the port on which it will listen. m_HttpServer = pion::http::server_ptr(new pion::http::server(m_DefaultScheduler, endpoint));
m_HttpServer->start();
Problem: There is couple of handle leaks for every http request processing.i.e when client sends the http request, I could see couple of handle leaks.
Any help is appreciated
Regards,Rohan
|
|
From: Mike D. <md...@sp...> - 2015-01-10 16:33:47
|
That approach sounds right to me. Use the handler to just spawn off your long-running job, cache the parameters in the job (in particular keeping the tcp conn pointer alive will keep the connection open), and return right away. Then when the job is finished, use response_writer to schedule an async response to the request.
-Mike
From: Rohan Shetty <she...@ya...<mailto:she...@ya...>>
Reply-To: Rohan Shetty <she...@ya...<mailto:she...@ya...>>
Date: Friday, January 9, 2015 at 9:40 PM
To: Microsoft Office User <md...@sp...<mailto:md...@sp...>>, "pio...@li...<mailto:pio...@li...>" <pio...@li...<mailto:pio...@li...>>
Subject: Re: [pion-users] How to increase the the "concurrent processing threads" in pion - Handle leak
Hi Mike,
Thanks for the detailed response.
In my case, I have a blocking handler. I guess every blocking handler consumes a thread. Please correct if my understanding is not right. I would appreciate if you suggest a solution(or a work around).
e.g. would the following work?
- In the handler, I would store the variables (PtrHttpRequest, PtrTcpConn). And without sending the response, I would return from the handler.
- I will use a thread, which would make use of the above variables(PtrHttpRequest, PtrTcpConn), and send the response.
Would the above approach consume a pion thread?
Any help is appreciated.
Regards,
Rohan
________________________________
From: Mike Dickey <md...@sp...<mailto:md...@sp...>>
To: Rohan Shetty <she...@ya...<mailto:she...@ya...>>; "pio...@li...<mailto:pio...@li...>" <pio...@li...<mailto:pio...@li...>>
Sent: Friday, January 9, 2015 10:37 PM
Subject: Re: [pion-users] How to increase the the "concurrent processing threads" in pion - Handle leak
Pion is asynchronous, so 8 threads should be able to handle many thousands of concurrent connections. Unless you have some sort of blocking code in your handler, there is probably no reason to increase it beyond the number of physical cores (8 threads should fully utilize 8 physical cores).
From: Rohan Shetty <she...@ya...<mailto:she...@ya...>>
Reply-To: Rohan Shetty <she...@ya...<mailto:she...@ya...>>
Date: Thursday, January 8, 2015 at 9:30 PM
To: "pio...@li...<mailto:pio...@li...>" <pio...@li...<mailto:pio...@li...>>
Subject: [pion-users] How to increase the the "concurrent processing threads" in pion - Handle leak
Hi,
I use the following code, which is working fine
pion::http::server_ptrm_HttpServer;
unsigned int m_iPort = 0
//Listen only in the loopback interface
boost::asio::ip::address addr(boost::asio::ip::address_v4::loopback());
// If port =0, then the HttpServer would take a free available port
boost::asio::ip::tcp::endpoint endpoint(addr, m_iPort);
// Create a web server and specify the port on which it will listen.
m_HttpServer = pion::http::server_ptr(new pion::http::server(endpoint));
m_HttpServer->start();
Following is the handler used for testing this.
void CPalHttpServer::RequestHandlerForPalRoot(constrequest_ptr & PtrHttpRequest,
connection_ptr & PtrTcpConn)
{
string HELLO_HTML = "<html><body>PAL Service!</body></html>";
response_writer_ptr writer(response_writer::create(PtrTcpConn, * PtrHttpRequest,
boost::bind(&connection::finish, PtrTcpConn)));
writer->write(HELLO_HTML);
writer->send()
}
By default PION supports around 8 threads, which will limit only 8 concurrent HTTP requests.
I tried the following code, in which I have tried to increasing the thread to 100. Is this the right ?
pion::http::server_ptrm_HttpServer;
pion::single_service_scheduler m_DefaultScheduler;
m_DefaultScheduler.set_num_threads(100);
unsigned int m_iPort = 0
//Listen only in the loopback interface
boost::asio::ip::address addr(boost::asio::ip::address_v4::loopback());
// If port =0, then the HttpServer would take a free available port
boost::asio::ip::tcp::endpoint endpoint(addr, m_iPort);
// Create a web server and specify the port on which it will listen.
m_HttpServer = pion::http::server_ptr(new pion::http::server(m_DefaultScheduler, endpoint));
m_HttpServer->start();
Problem: There is couple of handle leaks for every http request processing.
i.e when client sends the http request, I could see couple of handle leaks.
Any help is appreciated
Regards,
Rohan
|
|
From: Mike D. <md...@sp...> - 2015-01-09 17:23:28
|
Pion is asynchronous, so 8 threads should be able to handle many thousands of concurrent connections. Unless you have some sort of blocking code in your handler, there is probably no reason to increase it beyond the number of physical cores (8 threads should fully utilize 8 physical cores).
From: Rohan Shetty <she...@ya...<mailto:she...@ya...>>
Reply-To: Rohan Shetty <she...@ya...<mailto:she...@ya...>>
Date: Thursday, January 8, 2015 at 9:30 PM
To: "pio...@li...<mailto:pio...@li...>" <pio...@li...<mailto:pio...@li...>>
Subject: [pion-users] How to increase the the "concurrent processing threads" in pion - Handle leak
Hi,
I use the following code, which is working fine
pion::http::server_ptrm_HttpServer;
unsigned int m_iPort = 0
//Listen only in the loopback interface
boost::asio::ip::address addr(boost::asio::ip::address_v4::loopback());
// If port =0, then the HttpServer would take a free available port
boost::asio::ip::tcp::endpoint endpoint(addr, m_iPort);
// Create a web server and specify the port on which it will listen.
m_HttpServer = pion::http::server_ptr(new pion::http::server(endpoint));
m_HttpServer->start();
Following is the handler used for testing this.
void CPalHttpServer::RequestHandlerForPalRoot(constrequest_ptr & PtrHttpRequest,
connection_ptr & PtrTcpConn)
{
string HELLO_HTML = "<html><body>PAL Service!</body></html>";
response_writer_ptr writer(response_writer::create(PtrTcpConn, * PtrHttpRequest,
boost::bind(&connection::finish, PtrTcpConn)));
writer->write(HELLO_HTML);
writer->send()
}
By default PION supports around 8 threads, which will limit only 8 concurrent HTTP requests.
I tried the following code, in which I have tried to increasing the thread to 100. Is this the right ?
pion::http::server_ptrm_HttpServer;
pion::single_service_scheduler m_DefaultScheduler;
m_DefaultScheduler.set_num_threads(100);
unsigned int m_iPort = 0
//Listen only in the loopback interface
boost::asio::ip::address addr(boost::asio::ip::address_v4::loopback());
// If port =0, then the HttpServer would take a free available port
boost::asio::ip::tcp::endpoint endpoint(addr, m_iPort);
// Create a web server and specify the port on which it will listen.
m_HttpServer = pion::http::server_ptr(new pion::http::server(m_DefaultScheduler, endpoint));
m_HttpServer->start();
Problem: There is couple of handle leaks for every http request processing.
i.e when client sends the http request, I could see couple of handle leaks.
Any help is appreciated
Regards,
Rohan
|
|
From: Rohan S. <she...@ya...> - 2015-01-09 05:31:06
|
Hi,
I use the following code, which is working fine
pion::http::server_ptr m_HttpServer;unsigned int m_iPort = 0
//Listen only in the loopback interfaceboost::asio::ip::address addr(boost::asio::ip::address_v4::loopback());
// If port =0, then the HttpServer would take a free available portboost::asio::ip::tcp::endpoint endpoint(addr, m_iPort);
// Create a web server and specify the port on which it will listen. m_HttpServer = pion::http::server_ptr(new pion::http::server(endpoint));
m_HttpServer->start();
Following is the handler used for testing this.
void CPalHttpServer::RequestHandlerForPalRoot(const request_ptr & PtrHttpRequest, connection_ptr & PtrTcpConn){ string HELLO_HTML = "<html><body>PAL Service!</body></html>";
response_writer_ptr writer(response_writer::create(PtrTcpConn, * PtrHttpRequest, boost::bind(&connection::finish, PtrTcpConn)));
writer->write(HELLO_HTML);
writer->send()}
By default PION supports around 8 threads, which will limit only 8 concurrent HTTP requests.
I tried the following code, in which I have tried to increasing the thread to 100. Is this the right ?
pion::http::server_ptr m_HttpServer;pion::single_service_scheduler m_DefaultScheduler;m_DefaultScheduler.set_num_threads(100);unsigned int m_iPort = 0
//Listen only in the loopback interfaceboost::asio::ip::address addr(boost::asio::ip::address_v4::loopback());
// If port =0, then the HttpServer would take a free available portboost::asio::ip::tcp::endpoint endpoint(addr, m_iPort);
// Create a web server and specify the port on which it will listen. m_HttpServer = pion::http::server_ptr(new pion::http::server(m_DefaultScheduler, endpoint));
m_HttpServer->start();
Problem: There is couple of handle leaks for every http request processing.i.e when client sends the http request, I could see couple of handle leaks.
Any help is appreciated
Regards,Rohan
|
|
From: Sergei N. <ser...@gm...> - 2014-12-29 14:09:36
|
2014-12-25 4:33 GMT+03:00 Azareal - <inv...@li...>: > C:\Users\xxxx\Downloads\pion-5.0.7\build>cmake .. -G "Visual Studio 12 Win6 > 4" -DBOOST_ROOT=C:\Users\xxxx\Downloads\boost_1_57_0 -DBOOST_LIBRARYDIR=C:\ > Users\xxxx\Downloads\boost_1_57_0\stage\lib > > > > Boost include path: C:/Users/xxxx/Downloads/boost_1_57_0 > > Could not find the following Boost libraries: > > boost_thread > boost_system > boost_filesystem > boost_regex > boost_unit_test_framework > > No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the > directory containing Boost libraries or BOOST_ROOT to the location of > Boost. > Call Stack (most recent call first): > CMakeLists.txt:92 (find_package) > > > > Hello, Which version of cmake do you using? AFAIK, version 3.0.2 has "1.56.0" as latest in FindBoost.cmake. Could you please add additional option -DBoost_ADDITIONAL_VERSIONS="1.57.0" to cmake invocation command and try again? |
|
From: Azareal - <inv...@li...> - 2014-12-25 01:46:36
|
C:\Users\xxxx\Downloads\pion-5.0.7\build>cmake .. -G "Visual Studio 12 Win6
4" -DBOOST_ROOT=C:\Users\xxxx\Downloads\boost_1_57_0 -DBOOST_LIBRARYDIR=C:\
Users\xxxx\Downloads\boost_1_57_0\stage\lib
-- The CXX compiler identification is MSVC 18.0.30723.0
-- The C compiler identification is MSVC 18.0.30723.0
-- Check for working CXX compiler using: Visual Studio 12 2013 Win64
-- Check for working CXX compiler using: Visual Studio 12 2013 Win64 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working C compiler using: Visual Studio 12 2013 Win64
-- Check for working C compiler using: Visual Studio 12 2013 Win64 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
EXECUTABLE_OUTPUT_PATH = C:/Users/xxxx/Downloads/pion-5.0.7/build/Bin/
>>> Building Pion version: 5.0.7
-- Looking for include file pthread.h
-- Looking for include file pthread.h - not found
-- Found Threads: TRUE
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.0/Modules/FindBoost.cm
ake:1179 (message):
Unable to find the requested Boost libraries.
Boost version: 1.57.0
Boost include path: C:/Users/xxxx/Downloads/boost_1_57_0
Could not find the following Boost libraries:
boost_thread
boost_system
boost_filesystem
boost_regex
boost_unit_test_framework
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the
directory containing Boost libraries or BOOST_ROOT to the location of
Boost.
Call Stack (most recent call first):
CMakeLists.txt:92 (find_package)
CMake Error at CMakeLists.txt:98 (message):
Boost >= 1.35 required to build Pion
-- Configuring incomplete, errors occurred!
See also "C:/Users/xxxx/Downloads/pion-5.0.7/build/CMakeFiles/CMakeOutput.l
og".
See also "C:/Users/xxxx/Downloads/pion-5.0.7/build/CMakeFiles/CMakeError.lo
g".I'm not sure whether this is relevant, but I'm using a much newer version of Boost than what the READMEs said to use. |
|
From: David S. <ca...@gm...> - 2014-08-04 19:57:14
|
Howdy pion maintainers, I added a couple new pull requests. One adds VS2013 support and the other simplifies the interface of a few functions. There is still one outstanding that fixes a minor issue with the cmake files. All of these should be readily mergeable and I've previously signed the contribution form. Let me know if there's anything I can do to help with the maintenance of this github repo. Thanks, David Sankel |