cppcms-users Mailing List for CppCMS C++ Web Framework (Page 65)
Brought to you by:
artyom-beilis
You can subscribe to this list here.
| 2009 |
Jan
|
Feb
(22) |
Mar
|
Apr
(3) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
(15) |
Nov
(16) |
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(4) |
Feb
|
Mar
(8) |
Apr
(8) |
May
(8) |
Jun
(36) |
Jul
(63) |
Aug
(126) |
Sep
(47) |
Oct
(66) |
Nov
(46) |
Dec
(42) |
| 2011 |
Jan
(87) |
Feb
(24) |
Mar
(54) |
Apr
(21) |
May
(22) |
Jun
(18) |
Jul
(22) |
Aug
(101) |
Sep
(57) |
Oct
(33) |
Nov
(34) |
Dec
(66) |
| 2012 |
Jan
(64) |
Feb
(76) |
Mar
(73) |
Apr
(105) |
May
(93) |
Jun
(83) |
Jul
(84) |
Aug
(88) |
Sep
(57) |
Oct
(59) |
Nov
(35) |
Dec
(49) |
| 2013 |
Jan
(67) |
Feb
(17) |
Mar
(49) |
Apr
(64) |
May
(87) |
Jun
(64) |
Jul
(93) |
Aug
(23) |
Sep
(15) |
Oct
(16) |
Nov
(62) |
Dec
(73) |
| 2014 |
Jan
(5) |
Feb
(23) |
Mar
(21) |
Apr
(11) |
May
(1) |
Jun
(19) |
Jul
(27) |
Aug
(16) |
Sep
(5) |
Oct
(37) |
Nov
(12) |
Dec
(9) |
| 2015 |
Jan
(7) |
Feb
(7) |
Mar
(44) |
Apr
(28) |
May
(5) |
Jun
(12) |
Jul
(8) |
Aug
|
Sep
(39) |
Oct
(34) |
Nov
(30) |
Dec
(34) |
| 2016 |
Jan
(66) |
Feb
(23) |
Mar
(33) |
Apr
(15) |
May
(11) |
Jun
(15) |
Jul
(26) |
Aug
(4) |
Sep
(1) |
Oct
(30) |
Nov
(10) |
Dec
|
| 2017 |
Jan
(52) |
Feb
(9) |
Mar
(24) |
Apr
(16) |
May
(9) |
Jun
(12) |
Jul
(33) |
Aug
(8) |
Sep
|
Oct
(1) |
Nov
(2) |
Dec
(6) |
| 2018 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
(14) |
Jun
(1) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(8) |
Nov
(2) |
Dec
(2) |
| 2019 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(9) |
Jul
(6) |
Aug
(25) |
Sep
(10) |
Oct
(10) |
Nov
(6) |
Dec
|
| 2021 |
Jan
|
Feb
|
Mar
(7) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(9) |
Oct
(1) |
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2025 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2026 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Sab <rim...@gm...> - 2013-01-09 16:34:41
|
Makes sense, thanks! You really seemed to think of all kind of functionality that users might need in the future. Respect! Great framework! Great support! Sab |
|
From: Artyom B. <art...@ya...> - 2013-01-09 12:48:32
|
You can pass whatever you need to application factory object that would pass it to the application itself: See: http://cppcms.com/cppcms_ref/latest/namespacecppcms.html#afc4fc49051725b6b4722bac89b1d1425 Or create your own factory that does what ever you need: http://cppcms.com/cppcms_ref/latest/structcppcms_1_1applications__pool_1_1factory.html Remember that the applications are created on demand so you don't know how many application instances would be running simultaneously. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ ----- Original Message ----- > From: Sab <rim...@gm...> > To: cpp...@li... > Cc: > Sent: Wednesday, January 9, 2013 2:32 PM > Subject: [Cppcms-users] Passing objects to application pool from outside > > Hi guys, > > I’m running the CppCMS service as an own thread that I start in my applications > main (the main has other tasks to do, so I can’t block it). In the > cppcms::application classes I would like to have access to an object that is > created outside the service, in my main, before the CppCMS service is started. > What would be the best way to pass a pointer of this object to the applications, > > so that I can safely access its functions while processing requests? > > Sab > > > > ------------------------------------------------------------------------------ > Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery > and much more. Keep your Java skills current with LearnJavaNow - > 200+ hours of step-by-step video tutorials by Java experts. > SALE $49.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122612 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
|
From: Sab <rim...@gm...> - 2013-01-09 12:32:55
|
Hi guys, I’m running the CppCMS service as an own thread that I start in my applications main (the main has other tasks to do, so I can’t block it). In the cppcms::application classes I would like to have access to an object that is created outside the service, in my main, before the CppCMS service is started. What would be the best way to pass a pointer of this object to the applications, so that I can safely access its functions while processing requests? Sab |
|
From: Christian G. <chr...@gm...> - 2013-01-09 09:46:46
|
2013/1/9 Mario Palomo <mp...@us...>: > On 08/01/13 14:02, Christian Gmeiner wrote: >> Hi all... >> >> at the moment I am playing with some REST stuff and run into this >> problem. I want to use put to update >> an resource. Now I need to access the put payload, but I don't know >> how I could do this. >> [...] > Hi Mario > > I use this to get the payload of a PUT request in the string 'content_': > > std::pair<void *, size_t> body = request().raw_post_data(); > content_ = std::string((const char *)body.first, body.second); > works... thanks very much -- Christian Gmeiner, MSc |
|
From: Mario P. <mp...@us...> - 2013-01-09 08:46:57
|
On 08/01/13 14:02, Christian Gmeiner wrote: > Hi all... > > at the moment I am playing with some REST stuff and run into this > problem. I want to use put to update > an resource. Now I need to access the put payload, but I don't know > how I could do this. > [...] I use this to get the payload of a PUT request in the string 'content_': std::pair<void *, size_t> body = request().raw_post_data(); content_ = std::string((const char *)body.first, body.second); Mario |
|
From: Christian G. <chr...@gm...> - 2013-01-08 13:02:53
|
Hi all...
at the moment I am playing with some REST stuff and run into this
problem. I want to use put to update
an resource. Now I need to access the put payload, but I don't know
how I could do this.
Here is the http traffic.
Request URL:
http://10.204.119.7/tssw/rest/display
Request Method:
PUT
Status Code:
200 Ok
Request Headersview source
Accept:
*/*
Accept-Charset:
ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:
gzip,deflate,sdch
Accept-Language:
en-US,en;q=0.8,de;q=0.6
Connection:
keep-alive
Content-Length:
88
Content-Type:
application/xml
Cookie:
cppcms_session=I6fd1b57f7eb1099378afe96f557b2419
DNT:
1
Host:
10.204.119.7
Origin:
chrome-extension://fhjcajmcbmldlhcimfajhfbgofnpcjmb
User-Agent:
Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.11 (KHTML, like Gecko)
Chrome/23.0.1271.97 Safari/537.11
Request Payload
{ "brightness" : 10 }
Response Headersview source
Connection:
close
Content-Type:
text/html; charset=utf-8
Server:
CppCMS-Embedded/1.0.3
X-Powered-By:
CppCMS/1.0.3
thanks
--
Christian Gmeiner, MSc
|
|
From: Artyom B. <art...@ya...> - 2013-01-08 09:10:51
|
Try to explain what exactly you are trying to do and what behavior do you want. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Sergey Shutov <ser...@gm...> >To: cpp...@li... >Sent: Tuesday, January 8, 2013 2:00 AM >Subject: Re: [Cppcms-users] Async for specific users > >Artyom, this is right way? > >booster::intrusive_ptr<cppcms::application> messaging = new >apps::messaging(*srv_); >srv_->applications_pool().mount(messaging, >cppcms::mount_point("/messaging/1_2")); > > > >------------------------------------------------------------------------------ >Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS >and more. Get SQL Server skills now (including 2012) with LearnDevNow - >200+ hours of step-by-step video tutorials by Microsoft MVPs and experts. >SALE $99.99 this month only - learn more at: >http://p.sf.net/sfu/learnmore_122512 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Sergey S. <ser...@gm...> - 2013-01-08 00:00:54
|
Artyom, this is right way?
booster::intrusive_ptr<cppcms::application> messaging = new
apps::messaging(*srv_);
srv_->applications_pool().mount(messaging,
cppcms::mount_point("/messaging/1_2"));
|
|
From: Sergey S. <ser...@gm...> - 2013-01-07 23:54:56
|
Example: facebook messaging box |
|
From: Sergey S. <ser...@gm...> - 2013-01-07 23:49:22
|
Hi. I have example: user_id: 1 user_id: 2 user_id: 3 user_id: 4 user_id: 5 How i can make long polling only for 1,2,3 users id and other polling only for 4,5? 1 \ 2 --> first poll 3 / 4 \ 5 --> second poll |
|
From: SIMON A. <All...@su...> - 2013-01-07 16:24:12
|
I've added a ticket there http://sourceforge.net/p/cppcms/bugs/85/ Otherwise about my import function, as now I'm myself no more sure if it's a good idea, do you think it is one, considering my use case (admitting the function is coded in a "clean" way)? Regards, Allan SIMON Tatoeba Administrator (Sysko) ________________________________ De : Artyom Beilis [art...@ya...] Date d'envoi : lundi 7 janvier 2013 15:51 À : cpp...@li... Objet : Re: [Cppcms-users] RE : CppDB import from file I see... I think I know what problem is. Fill a ticket please :-) Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ ________________________________ From: SIMON Allan <All...@su...> To: Artyom Beilis <art...@ya...>; "cpp...@li..." <cpp...@li...> Sent: Monday, January 7, 2013 5:32 PM Subject: [Cppcms-users] RE : CppDB import from file Actually in cppcms I would like to make a small website that permits me to do more or less like phpmyadmin, i.e controlling my sqlite3 database from a web interface. So I may receive some string containing several SQL request. For the ; outside it's tricky because you need to know when you're outside (using regex?) About the prepared statement, I was going to talk about it, because I've tried to do a simple "split" function like this int SqliteModel::import_sql_file( const std::string &sqlFilePath ) { try { std::ifstream f(sqlFilePath.c_str()); std::string fileStr( (std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>() ); sqliteDb << fileStr << cppdb::exec; size_t current = 0; size_t next = -1; do { current = next + 1; next = fileStr.find_first_of( ";", current ); std::string tmpRequest = fileStr.substr( current, next - current ); sqliteDb << tmpRequest << cppdb::exec; } while (next != std::string::npos); } catch(std::exception const &e) { BOOSTER_ERROR("cppcms") << e.what(); return 1; } return 0; } and it will segfault (no exception, a old goold segfault) when I try to execute a string containing nothing or a comment or a set of space with nothing less the backtrace generates #0 0xb61eee96 in sqlite3_clear_bindings () from /usr/lib/i386-linux-gnu/libsqlite3.so.0 #1 0xb7c6433a in cppdb::sqlite3_backend::statement::reset (this=0x80710c8) at /home/allan/Desktop/projet/cppdb-0.3.0/drivers/sqlite3_backend.cpp:226 #2 0xb7d81b95 in cppdb::backend::statements_cache::put (this=0x805d37c, p_in=0x80710c8) at /home/allan/Desktop/projet/cppdb-0.3.0/src/backend.cpp:146 #3 0xb7d81d43 in cppdb::backend::statement::dispose (p=0x80710c8) at /home/allan/Desktop/projet/cppdb-0.3.0/src/backend.cpp:54 #4 0xb7d8bbdb in reset (v=0x0, this=0xbffff43c) at /home/allan/Desktop/projet/cppdb-0.3.0/./cppdb/ref_ptr.h:109 #5 cppdb::statement::~statement (this=0xbffff438, __in_chrg=<optimized out>) at /home/allan/Desktop/projet/cppdb-0.3.0/src/frontend.cpp:218 #6 0x080536fb in models::SqliteModel::import_sql_file(std::string const&) () #7 0x0804f6ec in main () which is in line 226 of sqlite3_backend of cppdb sqlite3_clear_bindings(st_); st_ being a NULL pointer (0x0) Regards, Allan SIMON Tatoeba Administrator (Sysko) ________________________________ De : Artyom Beilis [art...@ya...] Date d'envoi : lundi 7 janvier 2013 15:11 À : cpp...@li... Objet : Re: [Cppcms-users] CppDB import from file Why wouldn't you run the sqlite executable as is? Most of SQL clients would do SQL import much better job. Also note that you can quite easily use ';' as separator. Sqlite3 does not support escape sequences but rather use ANSI SQL double quote 'can''t' == can't So if you split the file according to ";" outside the quotes you will be fine. Also note: don't use prepared statements (or use prepared_uncached ones)... Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ ________________________________ From: SIMON Allan <All...@su...> To: "cpp...@li..." <cpp...@li...> Sent: Monday, January 7, 2013 8:55 AM Subject: [Cppcms-users] CppDB import from file Hello I'm currently using CppDB and would like to have a function that takes in parameter a .sql file and that import it into a sqlite database I've tried to do it like this (see the code below) , but it seems that when CppDB does not like when you try to execute several Sqlrequest with only one cppdb::exec Of course I can't read the file and split it by lines (some requests are on several lines) and also no by splitting on ";" as my SQL file contains some ; inside string values. Does anyone already find a solution for this ? int SqliteModel::import_sql_file( const std::string &sqlFilePath ) { try { std::ifstream f(sqlFilePath.c_str()); std::string fileStr( (std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>() ); sqliteDb << fileStr << cppdb::exec; } catch(std::exception const &e) { BOOSTER_ERROR("cppcms") << e.what(); return 1; } return 0; } Regards, Allan SIMON Tatoeba.org<http://tatoeba.org/> Administrator (Sysko) ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412 _______________________________________________ Cppcms-users mailing list Cpp...@li...<mailto:Cpp...@li...> https://lists.sourceforge.net/lists/listinfo/cppcms-users ------------------------------------------------------------------------------ Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft MVPs and experts. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122412 _______________________________________________ Cppcms-users mailing list Cpp...@li...<mailto:Cpp...@li...> https://lists.sourceforge.net/lists/listinfo/cppcms-users |
|
From: Artyom B. <art...@ya...> - 2013-01-07 15:51:51
|
I see... I think I know what problem is. Fill a ticket please :-) Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: SIMON Allan <All...@su...> >To: Artyom Beilis <art...@ya...>; "cpp...@li..." <cpp...@li...> >Sent: Monday, January 7, 2013 5:32 PM >Subject: [Cppcms-users] RE : CppDB import from file > > > >Actually in cppcms I would like to make a small website that permits me to do more or less like phpmyadmin, i.e controlling my sqlite3 database from a web interface. So I may receive some string containing several SQL request. > >For the ; outside it's tricky because you need to know when you're outside (using regex?) > >About the prepared statement, I was going to talk about it, because I've tried to do a simple "split" function like this > > >int SqliteModel::import_sql_file( > const std::string &sqlFilePath >) { > try { > std::ifstream f(sqlFilePath.c_str()); > std::string fileStr( > (std::istreambuf_iterator<char>(f)), > std::istreambuf_iterator<char>() > ); > sqliteDb << fileStr << cppdb::exec; > size_t current = 0; > size_t next = -1; > do > { > current = next + 1; > next = fileStr.find_first_of( ";", current ); > std::string tmpRequest = fileStr.substr( current, next - current ); > sqliteDb << tmpRequest << cppdb::exec; > } while (next != std::string::npos); > > > } catch(std::exception const &e) { > BOOSTER_ERROR("cppcms") << e.what(); > return 1; > } > return 0; >} > >and it will segfault (no exception, a old goold segfault) when I try to execute a string containing nothing or a comment or a set of space with nothing less >the backtrace generates > >#0 0xb61eee96 in sqlite3_clear_bindings () from /usr/lib/i386-linux-gnu/libsqlite3.so.0 >#1 0xb7c6433a in cppdb::sqlite3_backend::statement::reset (this=0x80710c8) > at /home/allan/Desktop/projet/cppdb-0.3.0/drivers/sqlite3_backend.cpp:226 >#2 0xb7d81b95 in cppdb::backend::statements_cache::put (this=0x805d37c, p_in=0x80710c8) > at /home/allan/Desktop/projet/cppdb-0.3.0/src/backend.cpp:146 >#3 0xb7d81d43 in cppdb::backend::statement::dispose (p=0x80710c8) at /home/allan/Desktop/projet/cppdb-0.3.0/src/backend.cpp:54 >#4 0xb7d8bbdb in reset (v=0x0, this=0xbffff43c) at /home/allan/Desktop/projet/cppdb-0.3.0/./cppdb/ref_ptr.h:109 >#5 cppdb::statement::~statement (this=0xbffff438, __in_chrg=<optimized out>) > at /home/allan/Desktop/projet/cppdb-0.3.0/src/frontend.cpp:218 >#6 0x080536fb in models::SqliteModel::import_sql_file(std::string const&) () >#7 0x0804f6ec in main () > >which is in line 226 of sqlite3_backend of cppdb > >sqlite3_clear_bindings(st_); > >st_ being a NULL pointer (0x0) > > > > > > >Regards, > >Allan SIMON >Tatoeba Administrator (Sysko) > > >________________________________ > >De : Artyom Beilis [art...@ya...] >Date d'envoi : lundi 7 janvier 2013 15:11 >À : cpp...@li... >Objet : Re: [Cppcms-users] CppDB import from file > > >Why wouldn't you run the sqlite executable as is? > >Most of SQL clients would do SQL import much better job. > >Also note that you can quite easily use ';' as separator. Sqlite3 does not support escape sequences but rather use ANSI SQL >double quote 'can''t' == can't > >So if you split the file according to ";" outsidethe quotes you will be fine. > >Also note: don't use prepared statements (or use prepared_uncached ones)... > > > >Artyom Beilis >-------------- >CppCMS - C++ Web Framework: http://cppcms.com/ >CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > > >>________________________________ >> From: SIMON Allan <All...@su...> >>To: "cpp...@li..." <cpp...@li...> >>Sent: Monday, January 7, 2013 8:55 AM >>Subject: [Cppcms-users] CppDB import from file >> >> >> >> >> >>Hello >> >>I'm currently using CppDB and would like to have a function that takes in parameter a .sql file and that import it into a sqlite database >> >>I've tried to do it like this (see the code below) , but it seems that when CppDB does not like when you try to execute several Sqlrequest with only one cppdb::exec >> >>Of course I can't read the file and split it by lines (some requests are on several lines) and also no by splitting on ";" as my SQL file contains some ; inside string values. >>Does anyone already find a solution for this ? >> >> >>int SqliteModel::import_sql_file( >> const std::string &sqlFilePath >>) { >> try { >> std::ifstream f(sqlFilePath.c_str()); >> std::string fileStr( >> (std::istreambuf_iterator<char>(f)), >> std::istreambuf_iterator<char>() >> ); >> >> sqliteDb << fileStr << cppdb::exec; >> >> } catch(std::exception const &e) { >> BOOSTER_ERROR("cppcms") << e.what(); >> return 1; >> } >> return 0; >>} >> >> >> >> >> >> >>Regards, >> >>Allan SIMON >>Tatoeba.org Administrator (Sysko) >> >>------------------------------------------------------------------------------ >>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >>MVPs and experts. SALE $99.99 this month only -- learn more at: >>http://p.sf.net/sfu/learnmore_122412 >>_______________________________________________ >>Cppcms-users mailing list >>Cpp...@li... >>https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> >> >------------------------------------------------------------------------------ >Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >MVPs and experts. SALE $99.99 this month only -- learn more at: >http://p.sf.net/sfu/learnmore_122412 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: SIMON A. <All...@su...> - 2013-01-07 15:49:29
|
Actually in cppcms I would like to make a small website that permits me to do more or less like phpmyadmin, i.e controlling my sqlite3 database from a web interface. So I may receive some string containing several SQL request.
For the ; outside it's tricky because you need to know when you're outside (using regex?)
About the prepared statement, I was going to talk about it, because I've tried to do a simple "split" function like this
int SqliteModel::import_sql_file(
const std::string &sqlFilePath
) {
try {
std::ifstream f(sqlFilePath.c_str());
std::string fileStr(
(std::istreambuf_iterator<char>(f)),
std::istreambuf_iterator<char>()
);
sqliteDb << fileStr << cppdb::exec;
size_t current = 0;
size_t next = -1;
do
{
current = next + 1;
next = fileStr.find_first_of( ";", current );
std::string tmpRequest = fileStr.substr( current, next - current );
sqliteDb << tmpRequest << cppdb::exec;
} while (next != std::string::npos);
} catch(std::exception const &e) {
BOOSTER_ERROR("cppcms") << e.what();
return 1;
}
return 0;
}
and it will segfault (no exception, a old goold segfault) when I try to execute a string containing nothing or a comment or a set of space with nothing less
the backtrace generates
#0 0xb61eee96 in sqlite3_clear_bindings () from /usr/lib/i386-linux-gnu/libsqlite3.so.0
#1 0xb7c6433a in cppdb::sqlite3_backend::statement::reset (this=0x80710c8)
at /home/allan/Desktop/projet/cppdb-0.3.0/drivers/sqlite3_backend.cpp:226
#2 0xb7d81b95 in cppdb::backend::statements_cache::put (this=0x805d37c, p_in=0x80710c8)
at /home/allan/Desktop/projet/cppdb-0.3.0/src/backend.cpp:146
#3 0xb7d81d43 in cppdb::backend::statement::dispose (p=0x80710c8) at /home/allan/Desktop/projet/cppdb-0.3.0/src/backend.cpp:54
#4 0xb7d8bbdb in reset (v=0x0, this=0xbffff43c) at /home/allan/Desktop/projet/cppdb-0.3.0/./cppdb/ref_ptr.h:109
#5 cppdb::statement::~statement (this=0xbffff438, __in_chrg=<optimized out>)
at /home/allan/Desktop/projet/cppdb-0.3.0/src/frontend.cpp:218
#6 0x080536fb in models::SqliteModel::import_sql_file(std::string const&) ()
#7 0x0804f6ec in main ()
which is in line 226 of sqlite3_backend of cppdb
sqlite3_clear_bindings(st_);
st_ being a NULL pointer (0x0)
Regards,
Allan SIMON
Tatoeba Administrator (Sysko)
________________________________
De : Artyom Beilis [art...@ya...]
Date d'envoi : lundi 7 janvier 2013 15:11
À : cpp...@li...
Objet : Re: [Cppcms-users] CppDB import from file
Why wouldn't you run the sqlite executable as is?
Most of SQL clients would do SQL import much better job.
Also note that you can quite easily use ';' as separator. Sqlite3 does not support escape sequences but rather use ANSI SQL
double quote 'can''t' == can't
So if you split the file according to ";" outside the quotes you will be fine.
Also note: don't use prepared statements (or use prepared_uncached ones)...
Artyom Beilis
--------------
CppCMS - C++ Web Framework: http://cppcms.com/
CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
________________________________
From: SIMON Allan <All...@su...>
To: "cpp...@li..." <cpp...@li...>
Sent: Monday, January 7, 2013 8:55 AM
Subject: [Cppcms-users] CppDB import from file
Hello
I'm currently using CppDB and would like to have a function that takes in parameter a .sql file and that import it into a sqlite database
I've tried to do it like this (see the code below) , but it seems that when CppDB does not like when you try to execute several Sqlrequest with only one cppdb::exec
Of course I can't read the file and split it by lines (some requests are on several lines) and also no by splitting on ";" as my SQL file contains some ; inside string values.
Does anyone already find a solution for this ?
int SqliteModel::import_sql_file(
const std::string &sqlFilePath
) {
try {
std::ifstream f(sqlFilePath.c_str());
std::string fileStr(
(std::istreambuf_iterator<char>(f)),
std::istreambuf_iterator<char>()
);
sqliteDb << fileStr << cppdb::exec;
} catch(std::exception const &e) {
BOOSTER_ERROR("cppcms") << e.what();
return 1;
}
return 0;
}
Regards,
Allan SIMON
Tatoeba.org<http://tatoeba.org/> Administrator (Sysko)
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Cppcms-users mailing list
Cpp...@li...<mailto:Cpp...@li...>
https://lists.sourceforge.net/lists/listinfo/cppcms-users
|
|
From: Artyom B. <art...@ya...> - 2013-01-07 15:12:05
|
Why wouldn't you run the sqlite executable as is? Most of SQL clients would do SQL import much better job. Also note that you can quite easily use ';' as separator. Sqlite3 does not support escape sequences but rather use ANSI SQL double quote 'can''t' == can't So if you split the file according to ";" outsidethe quotes you will be fine. Also note: don't use prepared statements (or use prepared_uncached ones)... Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: SIMON Allan <All...@su...> >To: "cpp...@li..." <cpp...@li...> >Sent: Monday, January 7, 2013 8:55 AM >Subject: [Cppcms-users] CppDB import from file > > > > > >Hello > >I'm currently using CppDB and would like to have a function that takes in parameter a .sql file and that import it into a sqlite database > >I've tried to do it like this (see the code below) , but it seems that when CppDB does not like when you try to execute several Sqlrequest with only one cppdb::exec > >Of course I can't read the file and split it by lines (some requests are on several lines) and also no by splitting on ";" as my SQL file contains some ; inside string values. >Does anyone already find a solution for this ? > > >int SqliteModel::import_sql_file( > const std::string &sqlFilePath >) { > try { > std::ifstream f(sqlFilePath.c_str()); > std::string fileStr( > (std::istreambuf_iterator<char>(f)), > std::istreambuf_iterator<char>() > ); > > sqliteDb << fileStr << cppdb::exec; > > } catch(std::exception const &e) { > BOOSTER_ERROR("cppcms") << e.what(); > return 1; > } > return 0; >} > > > > > > >Regards, > >Allan SIMON >Tatoeba.org Administrator (Sysko) > >------------------------------------------------------------------------------ >Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >MVPs and experts. SALE $99.99 this month only -- learn more at: >http://p.sf.net/sfu/learnmore_122412 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: SIMON A. <All...@su...> - 2013-01-07 07:11:01
|
Hello
I'm currently using CppDB and would like to have a function that takes in parameter a .sql file and that import it into a sqlite database
I've tried to do it like this (see the code below) , but it seems that when CppDB does not like when you try to execute several Sqlrequest with only one cppdb::exec
Of course I can't read the file and split it by lines (some requests are on several lines) and also no by splitting on ";" as my SQL file contains some ; inside string values.
Does anyone already find a solution for this ?
int SqliteModel::import_sql_file(
const std::string &sqlFilePath
) {
try {
std::ifstream f(sqlFilePath.c_str());
std::string fileStr(
(std::istreambuf_iterator<char>(f)),
std::istreambuf_iterator<char>()
);
sqliteDb << fileStr << cppdb::exec;
} catch(std::exception const &e) {
BOOSTER_ERROR("cppcms") << e.what();
return 1;
}
return 0;
}
Regards,
Allan SIMON
Tatoeba.org Administrator (Sysko)
|
|
From: Artyom B. <art...@ya...> - 2013-01-04 13:48:56
|
Hello, CppCMS 1.0.3 was released today, it includes security bug fix. This bug allowed CppCMS encoding validation to accept some invalid UTF-8 sequeces which could potentially lead to various security problems like XSS and other. Note for users who used booster::locale::utf::utf_traits or functions booster::locale::conv::utf_to_utf directly rather than using built in CppCMS forms validation/XSS validation, you may need to recompile the application to get the updates The release is avalible on sourceforge and in the official repositories for Ubuntu oneiric, precise and quantal, Debian squeeze, Fedora 16 and 17, Centos 6 and Open Suse 11.4 and 12.1 Regards, Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ |
|
From: william l. <we...@gm...> - 2013-01-03 08:38:32
|
Hi, I was able to setup 500K connections based on 10 cppcms processes that listen on 10 ports. But when I try use single port with worker processes, it failed to accept more than 65535 connections. :( During testing, my clients are requesting from different machines(IPs) to same server port 8080, and server can only take 64K connections totally, after that, rest of requests are all timeout. This sounds incorrect to me, because requests are coming from different IPs, single server(IP+port) should be able to handle 64K connections per client IP, not totally. http://stackoverflow.com/questions/2332741/what-is-the-theoretical-maximum-number-of-open-tcp-connections-that-a-modern-lin Memory or File Descriptors are also not the reason, since same server instance can handle 500K connections as long as they are distributed on 10 ports/processes. I checked per process file open limit, also big enough to handle more than 64K. Got stucked :( Regards, William L. On Wed, Jan 2, 2013 at 3:52 PM, Artyom Beilis <art...@ya...> wrote: > > > > > >________________________________ > > From: william lee <we...@gm...> > >To: Artyom Beilis <art...@ya...>; > cpp...@li... > >Sent: Wednesday, January 2, 2013 9:38 AM > >Subject: Re: [Cppcms-users] CppCMS as Comet Server > > > > > >Hi. > >I'm happy to share the current status of my Comet Server effort. > > > > > > With Artyom's helping answer on client side issues, I start to pour > > > in connection for cppcms based comet server, long polling type. > > > > > > On Amazon EC2, I'm using M1 Extra Large Instance Type, with 15G Mem, 4 > Core(8EC2 CU), > > I successfully got 500K concurrent connections, I'm quite happy with > this half million result. > > Nice :-) > > > > At this payload, the system is still very good responsive, > > only memory usage is little high, at 12.xG used, left about > > 2.xG free. CPU usage is quite low, and related to real business logic. > > > > > > This is something I'm working on these days, reducing memory consumption > and improving general performance of asynchronous processes. > > > > > > > Right now, I'm using 10 cppcms based processes, and listen > > on different ports. > > I shall take a look at how to use same port number next, > > the prefolk method mentioned previously by Artyom. > > > > > > What you can do is to define service.worker_processes option > > > http://cppcms.com/wikipp/en/page/cppcms_1x_config#service.worker_processes > > Note, that when service::run is executed the application would > fork off processes. You may give a handler to > "cppcms::service::after_fork()" > that would be executed after fork to do some process specific stuff. > > Be careful with sharing resources many resources would likely to be opened, > like DB connections, IPC after forking. > > > > > > >Cheers, > >William L. > > > > Regards, > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > > > > > > >On Sat, Dec 29, 2012 at 1:50 AM, Artyom Beilis <art...@ya...> > wrote: > > > > > >>>________________________________ > >>> From: william lee <we...@gm...> > >>>To: Artyom Beilis <art...@ya...>; > cpp...@li... > >>>Sent: Friday, December 28, 2012 3:07 AM > >>>Subject: Re: [Cppcms-users] CppCMS as Comet Server > >> > >>> > >>> > >>>wow. you do benchmark on a laptop? :) > >> > >> > >>Yep > >> > >> > >>>Thanks for the detailed reply, and here is another reference I read > about: > >>> > >>> > >>> > http://webcache.googleusercontent.com/search?q=cache:2iV4meP2vIMJ:blog.urbanairship.com/blog/2010/09/29/linux-kernel-tuning-for-c500k/+&cd=1&hl=en&ct=clnk&gl=us > >>> > >>> > >>> > >>>It mentioned C65K Myth. > >>> > >> > >>Yes, you are right I've got little bit confused, > >>however it is still hard to benchmark more then 20K concurrent requests > >>as you need many clients on different ip addresses. > >> > >> > >>> > >>>Actually I expect more connection than that. > >>>The more connection I can have per server, the less cost it will be. > >>> > >> > >>So plan it as scalable application and use multiple processes. prefork > would work > >>better with many concurrent connections. > >> > >>In any case I don't see specific restrictions given enough memory and > configures OS. > >> > >> > >>> > >> > >>>I will try and see how it comes :) > >>> > >> > >>Tell us how did it worked out :-) > >> > >> > >> > >> > >>Artyom Beilis > >>-------------- > >>CppCMS - C++ Web Framework: http://cppcms.com/ > >>CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > >> > >>> > >>>thanks, > >>>William L. > >>> > >>> > >>> > >>>On Fri, Dec 28, 2012 at 5:54 AM, Artyom Beilis <art...@ya...> > wrote: > >>> > >>>Actually it is very good questions... > >>>> > >>>> > >>>>What is the performance, I did some benchmarks but had not full time > to publish them... > >>>> > >>>> > >>>>In general I could easily handle 20,000 connections and send updates > (SSE) using vanila CppCMS code > >>>>and broadcast around 50,000 messages per second (i.e. each connection > 2.5 msg/s) > >>>> > >>>> > >>>>Having 200-500 connections I could send about 100,000 messages per > second. > >>>> > >>>> > >>>>This was done using the most stright forward implementation using > event-stream API I had written about it in the blog. > >>>> > >>>> > >>>>Now to handle more than 20,000 K connections you need more network > interfaces (ips) (as TCP/IP can't handle theoretically more than 65K > connections in single IP address) which i couldn't check. > >>>> > >>>> > >>>>Now when you deal with Comet everything is handled in currently single > event loop one thread. So to scale up today the > >>>>easiest is to use prefork mode (more then 1 worker process see > service.worker_processes) > >>>>thus you would have several event loops and you can scale them > >>>>over multiple CPUs. It would be slower for low loads for much better > for high onces. > >>>> > >>>> > >>>>For example using 20,000 connections I could send 120,000 msgs/s i.e. > 6/msg per connection which was quite liner scale up over CPUs on this > particular machine. > >>>> > >>>> > >>>>However using prefork with comet would require IPC so you would need > to notify somehow each process on event, but it is must to > >>>>have to scale over multiple CPUs and especially over multiple hosts. > >>>> > >>>> > >>>>Also in general such benchmarking requires: > >>>> > >>>> > >>>>- Tuning TCP/IP stack, make big backlog - very important and setting > appropriate backlog option in application, also make sure you have wide > port range, etc. > >>>>- Ensure you have high ulimits to handle many descriptors > >>>> > >>>> > >>>>Also I should note that I expect to do some optimization in CppCMS 1.2 > to increase these numbers after some extensive profiling I did > >>>>(there is lots of space for improvement) > >>>> > >>>> > >>>>All these numbers I got running on Laptop with i5 2.4 GHz 2 cores 4 > threads 4GB RAM (of wich I used quite a few) > >>>> > >>>> > >>>> > >>>> > >>>>Regards > >>>> > >>>> > >>>> > >>>>Artyom Beilis > >>>>-------------- > >>>>CppCMS - C++ Web Framework: http://cppcms.com/ > >>>>CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > >>>> > >>>> > >>>> > >>>>>________________________________ > >>>>> From: william lee <we...@gm...> > >>>>>To: cpp...@li... > >>>>>Sent: Thursday, December 27, 2012 4:22 PM > >>>>>Subject: [Cppcms-users] CppCMS as Comet Server > >>>>> > >>>>> > >>>>> > >>>>>Hi, > >>>>>I'm thinking of using CppCMS to implement a Comet Server for Pushing > short messages to connected users via Http. > >>>>> > >>>>> > >>>>>Do you have any ideas from performance perspective, how much > connections CppCMS application can handle at the same time per server? > >>>>> > >>>>> > >>>>>The server spec is like 10G RAM, 8Core CPU etc, and http traffic is > not heavy, I'm thinking about keep a connection for 10 mins then release it > and let it reconnect back. > >>>>> > >>>>> > >>>>>If anyone have some benchmark result, that will be great! > >>>>> > >>>>> > >>>>>Thanks and appreciated > >>>>> > >>>>> > >>>>>Happy New Year > >>>>>William L. > > >>>>>------------------------------------------------------------------------------ > >>>>>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > >>>>>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills > current > >>>>>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > >>>>>MVPs and experts. ON SALE this month only -- learn more at: > >>>>>http://p.sf.net/sfu/learnmore_122712 > >>>>>_______________________________________________ > >>>>>Cppcms-users mailing list > >>>>>Cpp...@li... > >>>>>https://lists.sourceforge.net/lists/listinfo/cppcms-users > >>>>> > >>>>> > >>>>> > > >>>>------------------------------------------------------------------------------ > >>>>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > >>>>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > >>>>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > >>>>MVPs and experts. ON SALE this month only -- learn more at: > >>>>http://p.sf.net/sfu/learnmore_122712 > >>>>_______________________________________________ > >>>>Cppcms-users mailing list > >>>>Cpp...@li... > >>>>https://lists.sourceforge.net/lists/listinfo/cppcms-users > >>>> > >>>> > >>> > > >>>------------------------------------------------------------------------------ > >>>Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and > >>>much more. Get web development skills now with LearnDevNow - > >>>350+ hours of step-by-step video tutorials by Microsoft MVPs and > experts. > >>>SALE $99.99 this month only -- learn more at: > >>>http://p.sf.net/sfu/learnmore_122812 > >> > >>>_______________________________________________ > >>>Cppcms-users mailing list > >>>Cpp...@li... > >>>https://lists.sourceforge.net/lists/listinfo/cppcms-users > >>> > >>> > >>> > >> > > >>------------------------------------------------------------------------------ > >>Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and > >>much more. Get web development skills now with LearnDevNow - > >>350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. > >>SALE $99.99 this month only -- learn more at: > >>http://p.sf.net/sfu/learnmore_122812 > >> > >>_______________________________________________ > >>Cppcms-users mailing list > >>Cpp...@li... > >>https://lists.sourceforge.net/lists/listinfo/cppcms-users > >> > > > > >------------------------------------------------------------------------------ > >Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery > >and much more. Keep your Java skills current with LearnJavaNow - > >200+ hours of step-by-step video tutorials by Java experts. > >SALE $49.99 this month only -- learn more at: > >http://p.sf.net/sfu/learnmore_122612 > >_______________________________________________ > >Cppcms-users mailing list > >Cpp...@li... > >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > > > > > ------------------------------------------------------------------------------ > Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery > and much more. Keep your Java skills current with LearnJavaNow - > 200+ hours of step-by-step video tutorials by Java experts. > SALE $49.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122612 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
|
From: Artyom B. <art...@ya...> - 2013-01-02 07:53:04
|
>________________________________ > From: william lee <we...@gm...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Wednesday, January 2, 2013 9:38 AM >Subject: Re: [Cppcms-users] CppCMS as Comet Server > > >Hi. >I'm happy to share the current status of my Comet Server effort. > > > With Artyom's helping answer on client side issues, I start to pour > in connection for cppcms based comet server, long polling type. > > > On Amazon EC2, I'm using M1 Extra Large Instance Type, with 15G Mem, 4 Core(8EC2 CU), > I successfully got 500K concurrent connections, I'm quite happy with this half million result. Nice :-) > At this payload, the system is still very good responsive, > only memory usage is little high, at 12.xG used, left about > 2.xG free. CPU usage is quite low, and related to real business logic. > > This is something I'm working on these days, reducing memory consumption and improving general performance of asynchronous processes. > > > Right now, I'm using 10 cppcms based processes, and listen > on different ports. > I shall take a look at how to use same port number next, > the prefolk method mentioned previously by Artyom. > > What you can do is to define service.worker_processes option http://cppcms.com/wikipp/en/page/cppcms_1x_config#service.worker_processes Note, that when service::run is executed the application would fork off processes. You may give a handler to "cppcms::service::after_fork()" that would be executed after fork to do some process specific stuff. Be careful with sharing resources many resources would likely to be opened, like DB connections, IPC after forking. > > >Cheers, >William L. > Regards, Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > >On Sat, Dec 29, 2012 at 1:50 AM, Artyom Beilis <art...@ya...> wrote: > > >>>________________________________ >>> From: william lee <we...@gm...> >>>To: Artyom Beilis <art...@ya...>; cpp...@li... >>>Sent: Friday, December 28, 2012 3:07 AM >>>Subject: Re: [Cppcms-users] CppCMS as Comet Server >> >>> >>> >>>wow. you do benchmark on a laptop? :) >> >> >>Yep >> >> >>>Thanks for the detailed reply, and here is another reference I read about: >>> >>> >>>http://webcache.googleusercontent.com/search?q=cache:2iV4meP2vIMJ:blog.urbanairship.com/blog/2010/09/29/linux-kernel-tuning-for-c500k/+&cd=1&hl=en&ct=clnk&gl=us >>> >>> >>> >>>It mentioned C65K Myth. >>> >> >>Yes, you are right I've got little bit confused, >>however it is still hard to benchmark more then 20K concurrent requests >>as you need many clients on different ip addresses. >> >> >>> >>>Actually I expect more connection than that. >>>The more connection I can have per server, the less cost it will be. >>> >> >>So plan it as scalable application and use multiple processes. prefork would work >>better with many concurrent connections. >> >>In any case I don't see specific restrictions given enough memory and configures OS. >> >> >>> >> >>>I will try and see how it comes :) >>> >> >>Tell us how did it worked out :-) >> >> >> >> >>Artyom Beilis >>-------------- >>CppCMS - C++ Web Framework: http://cppcms.com/ >>CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >> >>> >>>thanks, >>>William L. >>> >>> >>> >>>On Fri, Dec 28, 2012 at 5:54 AM, Artyom Beilis <art...@ya...> wrote: >>> >>>Actually it is very good questions... >>>> >>>> >>>>What is the performance, I did some benchmarks but had not full time to publish them... >>>> >>>> >>>>In general I could easily handle 20,000 connections and send updates (SSE) using vanila CppCMS code >>>>and broadcast around 50,000 messages per second (i.e. each connection 2.5 msg/s) >>>> >>>> >>>>Having 200-500 connections I could send about 100,000 messages per second. >>>> >>>> >>>>This was done using the most stright forward implementation using event-stream API I had written about it in the blog. >>>> >>>> >>>>Now to handle more than 20,000 K connections you need more network interfaces (ips) (as TCP/IP can't handle theoretically more than 65K connections in single IP address) which i couldn't check. >>>> >>>> >>>>Now when you deal with Comet everything is handled in currently single event loop one thread. So to scale up today the >>>>easiest is to use prefork mode (more then 1 worker process see service.worker_processes) >>>>thus you would have several event loops and you can scale them >>>>over multiple CPUs. It would be slower for low loads for much better for high onces. >>>> >>>> >>>>For example using 20,000 connections I could send 120,000 msgs/s i.e. 6/msg per connection which was quite liner scale up over CPUs on this particular machine. >>>> >>>> >>>>However using prefork with comet would require IPC so you would need to notify somehow each process on event, but it is must to >>>>have to scale over multiple CPUs and especially over multiple hosts. >>>> >>>> >>>>Also in general such benchmarking requires: >>>> >>>> >>>>- Tuning TCP/IP stack, make big backlog - very important and setting appropriate backlog option in application, also make sure you have wide port range, etc. >>>>- Ensure you have high ulimits to handle many descriptors >>>> >>>> >>>>Also I should note that I expect to do some optimization in CppCMS 1.2 to increase these numbers after some extensive profiling I did >>>>(there is lots of space for improvement) >>>> >>>> >>>>All these numbers I got running on Laptop with i5 2.4 GHz 2 cores 4 threads 4GB RAM (of wich I used quite a few) >>>> >>>> >>>> >>>> >>>>Regards >>>> >>>> >>>> >>>>Artyom Beilis >>>>-------------- >>>>CppCMS - C++ Web Framework: http://cppcms.com/ >>>>CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >>>> >>>> >>>> >>>>>________________________________ >>>>> From: william lee <we...@gm...> >>>>>To: cpp...@li... >>>>>Sent: Thursday, December 27, 2012 4:22 PM >>>>>Subject: [Cppcms-users] CppCMS as Comet Server >>>>> >>>>> >>>>> >>>>>Hi, >>>>>I'm thinking of using CppCMS to implement a Comet Server for Pushing short messages to connected users via Http. >>>>> >>>>> >>>>>Do you have any ideas from performance perspective, how much connections CppCMS application can handle at the same time per server? >>>>> >>>>> >>>>>The server spec is like 10G RAM, 8Core CPU etc, and http traffic is not heavy, I'm thinking about keep a connection for 10 mins then release it and let it reconnect back. >>>>> >>>>> >>>>>If anyone have some benchmark result, that will be great! >>>>> >>>>> >>>>>Thanks and appreciated >>>>> >>>>> >>>>>Happy New Year >>>>>William L. >>>>>------------------------------------------------------------------------------ >>>>>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >>>>>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >>>>>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >>>>>MVPs and experts. ON SALE this month only -- learn more at: >>>>>http://p.sf.net/sfu/learnmore_122712 >>>>>_______________________________________________ >>>>>Cppcms-users mailing list >>>>>Cpp...@li... >>>>>https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>>> >>>>> >>>>> >>>>------------------------------------------------------------------------------ >>>>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >>>>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >>>>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >>>>MVPs and experts. ON SALE this month only -- learn more at: >>>>http://p.sf.net/sfu/learnmore_122712 >>>>_______________________________________________ >>>>Cppcms-users mailing list >>>>Cpp...@li... >>>>https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>> >>>> >>> >>>------------------------------------------------------------------------------ >>>Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and >>>much more. Get web development skills now with LearnDevNow - >>>350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. >>>SALE $99.99 this month only -- learn more at: >>>http://p.sf.net/sfu/learnmore_122812 >> >>>_______________________________________________ >>>Cppcms-users mailing list >>>Cpp...@li... >>>https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> >>> >> >>------------------------------------------------------------------------------ >>Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and >>much more. Get web development skills now with LearnDevNow - >>350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. >>SALE $99.99 this month only -- learn more at: >>http://p.sf.net/sfu/learnmore_122812 >> >>_______________________________________________ >>Cppcms-users mailing list >>Cpp...@li... >>https://lists.sourceforge.net/lists/listinfo/cppcms-users >> > >------------------------------------------------------------------------------ >Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery >and much more. Keep your Java skills current with LearnJavaNow - >200+ hours of step-by-step video tutorials by Java experts. >SALE $49.99 this month only -- learn more at: >http://p.sf.net/sfu/learnmore_122612 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: william l. <we...@gm...> - 2013-01-02 07:39:01
|
Hi. I'm happy to share the current status of my Comet Server effort. With Artyom's helping answer on client side issues, I start to pour in connection for cppcms based comet server, long polling type. On Amazon EC2, I'm using M1 Extra Large Instance Type, with 15G Mem, 4 Core(8EC2 CU), I successfully got 500K concurrent connections, I'm quite happy with this half million result. At this payload, the system is still very good responsive, only memory usage is little high, at 12.xG used, left about 2.xG free. CPU usage is quite low, and related to real business logic. Right now, I'm using 10 cppcms based processes, and listen on different ports. I shall take a look at how to use same port number next, the prefolk method mentioned previously by Artyom. Cheers, William L. On Sat, Dec 29, 2012 at 1:50 AM, Artyom Beilis <art...@ya...> wrote: > > >________________________________ > > From: william lee <we...@gm...> > >To: Artyom Beilis <art...@ya...>; > cpp...@li... > >Sent: Friday, December 28, 2012 3:07 AM > >Subject: Re: [Cppcms-users] CppCMS as Comet Server > > > > > >wow. you do benchmark on a laptop? :) > > > Yep > > >Thanks for the detailed reply, and here is another reference I read about: > > > > > > > http://webcache.googleusercontent.com/search?q=cache:2iV4meP2vIMJ:blog.urbanairship.com/blog/2010/09/29/linux-kernel-tuning-for-c500k/+&cd=1&hl=en&ct=clnk&gl=us > > > > > > > >It mentioned C65K Myth. > > > > Yes, you are right I've got little bit confused, > however it is still hard to benchmark more then 20K concurrent requests > as you need many clients on different ip addresses. > > > > >Actually I expect more connection than that. > >The more connection I can have per server, the less cost it will be. > > > > So plan it as scalable application and use multiple processes. prefork > would work > better with many concurrent connections. > > In any case I don't see specific restrictions given enough memory and > configures OS. > > > > > >I will try and see how it comes :) > > > > Tell us how did it worked out :-) > > > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > > > >thanks, > >William L. > > > > > > > >On Fri, Dec 28, 2012 at 5:54 AM, Artyom Beilis <art...@ya...> > wrote: > > > >Actually it is very good questions... > >> > >> > >>What is the performance, I did some benchmarks but had not full time to > publish them... > >> > >> > >>In general I could easily handle 20,000 connections and send updates > (SSE) using vanila CppCMS code > >>and broadcast around 50,000 messages per second (i.e. each connection > 2.5 msg/s) > >> > >> > >>Having 200-500 connections I could send about 100,000 messages per > second. > >> > >> > >>This was done using the most stright forward implementation using > event-stream API I had written about it in the blog. > >> > >> > >>Now to handle more than 20,000 K connections you need more network > interfaces (ips) (as TCP/IP can't handle theoretically more than 65K > connections in single IP address) which i couldn't check. > >> > >> > >>Now when you deal with Comet everything is handled in currently single > event loop one thread. So to scale up today the > >>easiest is to use prefork mode (more then 1 worker process see > service.worker_processes) > >>thus you would have several event loops and you can scale them > >>over multiple CPUs. It would be slower for low loads for much better for > high onces. > >> > >> > >>For example using 20,000 connections I could send 120,000 msgs/s i.e. > 6/msg per connection which was quite liner scale up over CPUs on this > particular machine. > >> > >> > >>However using prefork with comet would require IPC so you would need to > notify somehow each process on event, but it is must to > >>have to scale over multiple CPUs and especially over multiple hosts. > >> > >> > >>Also in general such benchmarking requires: > >> > >> > >>- Tuning TCP/IP stack, make big backlog - very important and setting > appropriate backlog option in application, also make sure you have wide > port range, etc. > >>- Ensure you have high ulimits to handle many descriptors > >> > >> > >>Also I should note that I expect to do some optimization in CppCMS 1.2 > to increase these numbers after some extensive profiling I did > >>(there is lots of space for improvement) > >> > >> > >>All these numbers I got running on Laptop with i5 2.4 GHz 2 cores 4 > threads 4GB RAM (of wich I used quite a few) > >> > >> > >> > >> > >>Regards > >> > >> > >> > >>Artyom Beilis > >>-------------- > >>CppCMS - C++ Web Framework: http://cppcms.com/ > >>CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > >> > >> > >> > >>>________________________________ > >>> From: william lee <we...@gm...> > >>>To: cpp...@li... > >>>Sent: Thursday, December 27, 2012 4:22 PM > >>>Subject: [Cppcms-users] CppCMS as Comet Server > >>> > >>> > >>> > >>>Hi, > >>>I'm thinking of using CppCMS to implement a Comet Server for Pushing > short messages to connected users via Http. > >>> > >>> > >>>Do you have any ideas from performance perspective, how much > connections CppCMS application can handle at the same time per server? > >>> > >>> > >>>The server spec is like 10G RAM, 8Core CPU etc, and http traffic is not > heavy, I'm thinking about keep a connection for 10 mins then release it and > let it reconnect back. > >>> > >>> > >>>If anyone have some benchmark result, that will be great! > >>> > >>> > >>>Thanks and appreciated > >>> > >>> > >>>Happy New Year > >>>William L. > > >>>------------------------------------------------------------------------------ > >>>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > >>>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > >>>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > >>>MVPs and experts. ON SALE this month only -- learn more at: > >>>http://p.sf.net/sfu/learnmore_122712 > >>>_______________________________________________ > >>>Cppcms-users mailing list > >>>Cpp...@li... > >>>https://lists.sourceforge.net/lists/listinfo/cppcms-users > >>> > >>> > >>> > > >>------------------------------------------------------------------------------ > >>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > >>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > >>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > >>MVPs and experts. ON SALE this month only -- learn more at: > >>http://p.sf.net/sfu/learnmore_122712 > >>_______________________________________________ > >>Cppcms-users mailing list > >>Cpp...@li... > >>https://lists.sourceforge.net/lists/listinfo/cppcms-users > >> > >> > > > > >------------------------------------------------------------------------------ > >Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and > >much more. Get web development skills now with LearnDevNow - > >350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. > >SALE $99.99 this month only -- learn more at: > >http://p.sf.net/sfu/learnmore_122812 > >_______________________________________________ > >Cppcms-users mailing list > >Cpp...@li... > >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > > > > > ------------------------------------------------------------------------------ > Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and > much more. Get web development skills now with LearnDevNow - > 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts. > SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122812 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > |
|
From: Artyom B. <art...@ya...> - 2012-12-31 12:29:45
|
Also I recommend try to use long polling as fallback only as all modern browsers already support HTML5 EventSource (server-sent events) Long polling would be much heavier. Note the benchmark results I had shown are for EventSource and not long polling. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: william lee <we...@gm...> >To: Artyom Beilis <art...@ya...>; cpp...@li... >Sent: Monday, December 31, 2012 1:50 PM >Subject: Re: [Cppcms-users] comet server empty reply > > >Yes! You are absolutely right! >after change the config.js setting, now I get it working as expected. > > >I'm always struggling with code and missing the settings thing.... > > >This is a long polling server + client, I want to see how many concurrent connection it can handle :) > > >Thank you again, Artyom! > > >Best Regards, >William L. > > > >On Mon, Dec 31, 2012 at 3:37 PM, Artyom Beilis <art...@ya...> wrote: > >First of all, take a look on: >> >>http://cppcms.com/wikipp/en/page/cppcms_1x_config#http.timeout >> >> >>You may want to increase this parameter. >> >>2nd what kind of chat do you implement? >> >> >>Long polling or type of event-stream? >> >> >> >>Also the client should be ready for disconnections >>and restart connection. You can also send some kind of applicative keep-alive >>messages (not HTTP keep alive) so the client would know that the server is up. >> >> >> >> >>Artyom Beilis >>-------------- >>CppCMS - C++ Web Framework: http://cppcms.com/ >>CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >> >> >> >>>________________________________ >>> From: Lee Elenbaas <lee...@gm...> >>>To: cpp...@li... >>>Sent: Monday, December 31, 2012 9:05 AM >>>Subject: Re: [Cppcms-users] comet server empty reply >>> >>> >>> >>>this sounds like a timeout from the client side - not from the server >>>connection needs to be kept alive from both ends >>> >>> >>> >>>On Mon, Dec 31, 2012 at 8:00 AM, william lee <we...@gm...> wrote: >>> >>>btw, I did sent "Connection: Keep-Alive" from client via connect, but it doesn't make any difference. >>>> >>>> >>>>thanks, >>>>William L. >>>> >>>> >>>> >>>>On Mon, Dec 31, 2012 at 1:47 PM, william lee <we...@gm...> wrote: >>>> >>>>Hi, >>>>>I'm using CppCMS to create a comet server, pretty much same as the Chat example. I release context and store it in a map for broadcast or targeted reply later. >>>>> >>>>> >>>>>At same time, I'm using libcurl to create a client app to connect to cppcms comet server via http 127.0.0.1:8080 GET method >>>>> >>>>> >>>>>I found a interesting thing, like 10s-15s after http connected, the client side will disconnect and print "Empty reply from server", "Server returned nothing (no headers, no data)". >>>>>From comet server side code, there is no timeout release context. >>>>> >>>>> >>>>>This behavior happens on Win7 and ubuntu server. >>>>> >>>>> >>>>>Anyone have idea why such thing happen? >>>>>Is there any limitation with long polling that caused this? I expect a live HTTP connection can wait for several minutes. >>>>> >>>>> >>>>>thanks! >>>>>William L. >>>> >>>>------------------------------------------------------------------------------ >>>>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >>>>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >>>>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >>>>MVPs and experts. SALE $99.99 this month only -- learn more at: >>>>http://p.sf.net/sfu/learnmore_122412 >>>>_______________________________________________ >>>>Cppcms-users mailing list >>>>Cpp...@li... >>>>https://lists.sourceforge.net/lists/listinfo/cppcms-users >>>> >>>> >>> >>> >>> >>>-- >>>-- >>>lee >>>Lee Elenbaas >>>lee...@gm... >>> >>>------------------------------------------------------------------------------ >>>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >>>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >>>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >>>MVPs and experts. SALE $99.99 this month only -- learn more at: >>>http://p.sf.net/sfu/learnmore_122412 >>>_______________________________________________ >>>Cppcms-users mailing list >>>Cpp...@li... >>>https://lists.sourceforge.net/lists/listinfo/cppcms-users >>> >>> >>> >>------------------------------------------------------------------------------ >>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >>MVPs and experts. SALE $99.99 this month only -- learn more at: >>http://p.sf.net/sfu/learnmore_122412 >>_______________________________________________ >>Cppcms-users mailing list >>Cpp...@li... >>https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> > >------------------------------------------------------------------------------ >Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >MVPs and experts. SALE $99.99 this month only -- learn more at: >http://p.sf.net/sfu/learnmore_122412 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: william l. <we...@gm...> - 2012-12-31 11:50:32
|
Yes! You are absolutely right! after change the config.js setting, now I get it working as expected. I'm always struggling with code and missing the settings thing.... This is a long polling server + client, I want to see how many concurrent connection it can handle :) Thank you again, Artyom! Best Regards, William L. On Mon, Dec 31, 2012 at 3:37 PM, Artyom Beilis <art...@ya...> wrote: > First of all, take a look on: > > http://cppcms.com/wikipp/en/page/cppcms_1x_config#http.timeout > > You may want to increase this parameter. > > 2nd what kind of chat do you implement? > > Long polling or type of event-stream? > > Also the client should be ready for disconnections > and restart connection. You can also send some kind of applicative > keep-alive > messages (not HTTP keep alive) so the client would know that the server is > up. > > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ > > ------------------------------ > *From:* Lee Elenbaas <lee...@gm...> > *To:* cpp...@li... > *Sent:* Monday, December 31, 2012 9:05 AM > *Subject:* Re: [Cppcms-users] comet server empty reply > > this sounds like a timeout from the client side - not from the server > connection needs to be kept alive from both ends > > > On Mon, Dec 31, 2012 at 8:00 AM, william lee <we...@gm...> wrote: > > btw, I did sent "Connection: Keep-Alive" from client via connect, but it > doesn't make any difference. > > thanks, > William L. > > > On Mon, Dec 31, 2012 at 1:47 PM, william lee <we...@gm...> wrote: > > Hi, > I'm using CppCMS to create a comet server, pretty much same as the Chat > example. I release context and store it in a map for broadcast or targeted > reply later. > > At same time, I'm using libcurl to create a client app to connect to > cppcms comet server via http 127.0.0.1:8080 GET method > > I found a interesting thing, like 10s-15s after http connected, the client > side will disconnect and print "Empty reply from server", "Server returned > nothing (no headers, no data)". > From comet server side code, there is no timeout release context. > > This behavior happens on Win7 and ubuntu server. > > Anyone have idea why such thing happen? > Is there any limitation with long polling that caused this? I expect a > live HTTP connection can wait for several minutes. > > thanks! > William L. > > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET <http://asp.net/>, C# 2012, > HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122412 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > -- > -- > lee > Lee Elenbaas > lee...@gm... > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122412 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122412 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |
|
From: Artyom B. <art...@ya...> - 2012-12-31 07:37:33
|
First of all, take a look on: http://cppcms.com/wikipp/en/page/cppcms_1x_config#http.timeout You may want to increase this parameter. 2nd what kind of chat do you implement? Long polling or type of event-stream? Also the client should be ready for disconnections and restart connection. You can also send some kind of applicative keep-alive messages (not HTTP keep alive) so the client would know that the server is up. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Lee Elenbaas <lee...@gm...> >To: cpp...@li... >Sent: Monday, December 31, 2012 9:05 AM >Subject: Re: [Cppcms-users] comet server empty reply > > >this sounds like a timeout from the client side - not from the server >connection needs to be kept alive from both ends > > > >On Mon, Dec 31, 2012 at 8:00 AM, william lee <we...@gm...> wrote: > >btw, I did sent "Connection: Keep-Alive" from client via connect, but it doesn't make any difference. >> >> >>thanks, >>William L. >> >> >> >>On Mon, Dec 31, 2012 at 1:47 PM, william lee <we...@gm...> wrote: >> >>Hi, >>>I'm using CppCMS to create a comet server, pretty much same as the Chat example. I release context and store it in a map for broadcast or targeted reply later. >>> >>> >>>At same time, I'm using libcurl to create a client app to connect to cppcms comet server via http 127.0.0.1:8080 GET method >>> >>> >>>I found a interesting thing, like 10s-15s after http connected, the client side will disconnect and print "Empty reply from server", "Server returned nothing (no headers, no data)". >>>From comet server side code, there is no timeout release context. >>> >>> >>>This behavior happens on Win7 and ubuntu server. >>> >>> >>>Anyone have idea why such thing happen? >>>Is there any limitation with long polling that caused this? I expect a live HTTP connection can wait for several minutes. >>> >>> >>>thanks! >>>William L. >> >>------------------------------------------------------------------------------ >>Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >>MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >>with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >>MVPs and experts. SALE $99.99 this month only -- learn more at: >>http://p.sf.net/sfu/learnmore_122412 >>_______________________________________________ >>Cppcms-users mailing list >>Cpp...@li... >>https://lists.sourceforge.net/lists/listinfo/cppcms-users >> >> > > > >-- >-- >lee >Lee Elenbaas >lee...@gm... > >------------------------------------------------------------------------------ >Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >MVPs and experts. SALE $99.99 this month only -- learn more at: >http://p.sf.net/sfu/learnmore_122412 >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |
|
From: Lee E. <lee...@gm...> - 2012-12-31 07:06:17
|
this sounds like a timeout from the client side - not from the server connection needs to be kept alive from both ends On Mon, Dec 31, 2012 at 8:00 AM, william lee <we...@gm...> wrote: > btw, I did sent "Connection: Keep-Alive" from client via connect, but it > doesn't make any difference. > > thanks, > William L. > > > On Mon, Dec 31, 2012 at 1:47 PM, william lee <we...@gm...> wrote: > >> Hi, >> I'm using CppCMS to create a comet server, pretty much same as the Chat >> example. I release context and store it in a map for broadcast or targeted >> reply later. >> >> At same time, I'm using libcurl to create a client app to connect to >> cppcms comet server via http 127.0.0.1:8080 GET method >> >> I found a interesting thing, like 10s-15s after http connected, the >> client side will disconnect and print "Empty reply from server", "Server >> returned nothing (no headers, no data)". >> From comet server side code, there is no timeout release context. >> >> This behavior happens on Win7 and ubuntu server. >> >> Anyone have idea why such thing happen? >> Is there any limitation with long polling that caused this? I expect a >> live HTTP connection can wait for several minutes. >> >> thanks! >> William L. >> > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE $99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122412 > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > -- -- lee Lee Elenbaas lee...@gm... |
|
From: william l. <we...@gm...> - 2012-12-31 06:00:48
|
btw, I did sent "Connection: Keep-Alive" from client via connect, but it doesn't make any difference. thanks, William L. On Mon, Dec 31, 2012 at 1:47 PM, william lee <we...@gm...> wrote: > Hi, > I'm using CppCMS to create a comet server, pretty much same as the Chat > example. I release context and store it in a map for broadcast or targeted > reply later. > > At same time, I'm using libcurl to create a client app to connect to > cppcms comet server via http 127.0.0.1:8080 GET method > > I found a interesting thing, like 10s-15s after http connected, the client > side will disconnect and print "Empty reply from server", "Server returned > nothing (no headers, no data)". > From comet server side code, there is no timeout release context. > > This behavior happens on Win7 and ubuntu server. > > Anyone have idea why such thing happen? > Is there any limitation with long polling that caused this? I expect a > live HTTP connection can wait for several minutes. > > thanks! > William L. > |
|
From: william l. <we...@gm...> - 2012-12-31 05:48:00
|
Hi, I'm using CppCMS to create a comet server, pretty much same as the Chat example. I release context and store it in a map for broadcast or targeted reply later. At same time, I'm using libcurl to create a client app to connect to cppcms comet server via http 127.0.0.1:8080 GET method I found a interesting thing, like 10s-15s after http connected, the client side will disconnect and print "Empty reply from server", "Server returned nothing (no headers, no data)". >From comet server side code, there is no timeout release context. This behavior happens on Win7 and ubuntu server. Anyone have idea why such thing happen? Is there any limitation with long polling that caused this? I expect a live HTTP connection can wait for several minutes. thanks! William L. |