HttpConnection.cpp
Go to the documentation of this file.
1/****************************************************************************
2** Copyright (c) 2001-2014
3**
4** This file is part of the QuickFIX FIX Engine
5**
6** This file may be distributed under the terms of the quickfixengine.org
7** license as defined by quickfixengine.org and appearing in the file
8** LICENSE included in the packaging of this file.
9**
10** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
11** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12**
13** See http://www.quickfixengine.org/LICENSE for licensing information.
14**
15** Contact ask@quickfixengine.org if any conditions of this licensing are
16** not clear to you.
17**
18****************************************************************************/
19
20#ifdef _MSC_VER
21#include "stdafx.h"
22#else
23#include "config.h"
24#endif
25
26#include "HttpConnection.h"
27#include "HttpMessage.h"
28#include "HtmlBuilder.h"
29#include "Session.h"
30#include "Utility.h"
31
32using namespace HTML;
33
34namespace FIX
35{
37: m_socket( s )
38{
39 FD_ZERO( &m_fds );
40 FD_SET( m_socket, &m_fds );
41}
42
43bool HttpConnection::send( const std::string& msg )
44{
45 return socket_send( m_socket, msg.c_str(), msg.length() ) >= 0;
46}
47
49{
50 if( error > 0 )
52
54}
55
57{
58 struct timeval timeout = { 2, 0 };
59 fd_set readset = m_fds;
60
61 try
62 {
63 // Wait for input (1 second timeout)
64 int result = select( 1 + m_socket, &readset, 0, 0, &timeout );
65
66 if( result > 0 ) // Something to read
67 {
68 // We can read without blocking
69 ssize_t size = socket_recv( m_socket, m_buffer, sizeof(m_buffer) );
70 if ( size <= 0 ) { throw SocketRecvFailed( size ); }
72 }
73 else if( result == 0 ) // Timeout
74 {
75 disconnect( 408 );
76 return false;
77 }
78 else if( result < 0 ) // Error
79 {
80 throw SocketRecvFailed( result );
81 }
82
84 return true;
85 }
86 catch ( SocketRecvFailed& )
87 {
88 disconnect();
89 return false;
90 }
91}
92
93bool HttpConnection::readMessage( std::string& msg )
94throw( SocketRecvFailed )
95{
96 try
97 {
98 return m_parser.readHttpMessage( msg );
99 }
100 catch ( MessageParseError& )
101 {
102 disconnect( 400 );
103 }
104 return true;
105}
106
108{
109 std::string msg;
110 try
111 {
112 if( !readMessage(msg) )
113 return;
114 HttpMessage request( msg );
115 processRequest( request );
116 }
117 catch( InvalidMessage& )
118 {
119 disconnect( 400 );
120 return;
121 }
122
123 return;
124}
125
127{
128 int error = 200;
129 std::stringstream h;
130 std::stringstream b;
131 std::string titleString = "QuickFIX Engine Web Interface";
132
133 { HEAD head(h); head.text();
134 { CENTER center(h); center.text();
135 { TITLE title(h); title.text(titleString); }
136 { H1 h1(h); h1.text(titleString); }
137 }
138 { CENTER center(h); center.text();
139 { A a(h); a.href("/").text("HOME"); }
140 h << NBSP;
141 { A a(h); a.href(request.toString()).text("RELOAD"); }
142 }
143 HR hr(h); hr.text();
144 }
145
146 BODY body(b); body.text();
147
148 try
149 {
150 if( request.getRootString() == "/" )
151 processRoot( request, h, b );
152 else if( request.getRootString() == "/resetSessions" )
153 processResetSessions( request, h, b );
154 else if( request.getRootString() == "/refreshSessions" )
155 processRefreshSessions( request, h, b );
156 else if( request.getRootString() == "/enableSessions" )
157 processEnableSessions( request, h, b );
158 else if( request.getRootString() == "/disableSessions" )
159 processDisableSessions( request, h, b );
160 else if( request.getRootString() == "/session" )
161 processSession( request, h, b );
162 else if( request.getRootString() == "/resetSession" )
163 processResetSession( request, h, b );
164 else if( request.getRootString() == "/refreshSession" )
165 processRefreshSession( request, h, b );
166 else
167 error = 404;
168 }
169 catch( std::exception& e )
170 {
171 error = 400;
172 b << e.what();
173 }
174
175 std::string response = "<HTML>" + h.str() + b.str() + "</HTML>";
176 send( HttpMessage::createResponse(error, error == 200 ? response : "") );
177
178 disconnect();
179}
180
182( const HttpMessage& request, std::stringstream& h, std::stringstream& b )
183{
184 TABLE table(b); table.border(1).cellspacing(2).width(100).text();
185
186 { CAPTION caption(b); caption.text();
187 EM em(b); em.text();
188 b << Session::numSessions() << " Sessions managed by QuickFIX";
189 { HR hr(b); hr.text(); }
190 { b << NBSP; A a(b); a.href("/resetSessions" + request.getParameterString()).text("RESET"); }
191 { b << NBSP; A a(b); a.href("/refreshSessions" + request.getParameterString()).text("REFRESH"); }
192 { b << NBSP; A a(b); a.href("/enableSessions" + request.getParameterString()).text("ENABLE"); }
193 { b << NBSP; A a(b); a.href("/disableSessions" + request.getParameterString()).text("DISABLE"); }
194 }
195
196 { TR tr(b); tr.text();
197 { TD td(b); td.align("center").text("Session"); }
198 { TD td(b); td.align("center").text("ConnectionType"); }
199 { TD td(b); td.align("center").text("Enabled"); }
200 { TD td(b); td.align("center").text("Session Time"); }
201 { TD td(b); td.align("center").text("Logged On"); }
202 { TD td(b); td.align("center").text("Next Incoming"); }
203 { TD td(b); td.align("center").text("Next Outgoing"); }
204 }
205
206 std::set<SessionID> sessions = Session::getSessions();
207 std::set<SessionID>::iterator i;
208 for( i = sessions.begin(); i != sessions.end(); ++i )
209 {
210 Session* pSession = Session::lookupSession( *i );
211 if( !pSession ) continue;
212
213 { TR tr(b); tr.text();
214 { TD td(b); td.text();
215 std::string href = "/session?BeginString=" + i->getBeginString().getValue() +
216 "&SenderCompID=" + i->getSenderCompID().getValue() +
217 "&TargetCompID=" + i->getTargetCompID().getValue();
218 if( i->getSessionQualifier().size() )
219 href += "&SessionQualifier=" + i->getSessionQualifier();
220
221 A a(b); a.href(href).text(i->toString());
222 }
223 { TD td(b); td.text(pSession->isInitiator() ? "initiator" : "acceptor"); }
224 { TD td(b); td.text(pSession->isEnabled() ? "yes" : "no"); }
225 { TD td(b); td.text(pSession->isSessionTime(UtcTimeStamp()) ? "yes" : "no"); }
226 { TD td(b); td.text(pSession->isLoggedOn() ? "yes" : "no"); }
227 { TD td(b); td.text(pSession->getExpectedTargetNum()); }
228 { TD td(b); td.text(pSession->getExpectedSenderNum()); }
229 }
230 }
231}
232
234( const HttpMessage& request, std::stringstream& h, std::stringstream& b )
235{
236 try
237 {
238 HttpMessage copy = request;
239
240 bool confirm = false;
241 if( copy.hasParameter("confirm") && copy.getParameter("confirm") != "0" )
242 {
243 confirm = true;
244 std::set<SessionID> sessions = Session::getSessions();
245 std::set<SessionID>::iterator session;
246 for( session = sessions.begin(); session != sessions.end(); ++session )
247 Session::lookupSession( *session )->reset();
248 copy.removeParameter("confirm");
249 }
250
251 if( confirm )
252 {
253 h << "<META http-equiv='refresh' content=2;URL='" << "/'>";
254 CENTER center(b); center.text();
255 H2 h2(b); h2.text();
256 { A a(b); a.href("/").text("Sessions"); }
257 b << " have been reset";
258 }
259 else
260 {
261 { CENTER center(b); center.text();
262 H2 h2(b); h2.text();
263 b << "Are you sure you want to reset all sessions ?";
264 }
265 { CENTER center(b); center.text();
266 b << "[";
267 { A a(b); a.href(request.toString() + "?confirm=1").text("YES, reset sessions"); }
268 b << "]" << NBSP << "[";
269 { A a(b); a.href("/").text("NO, do not reset sessions"); }
270 b << "]";
271 }
272 }
273 }
274 catch( std::exception& e )
275 {
276 b << e.what();
277 }
278}
279
281( const HttpMessage& request, std::stringstream& h, std::stringstream& b )
282{
283 try
284 {
285 HttpMessage copy = request;
286
287 bool confirm = false;
288 if( copy.hasParameter("confirm") && copy.getParameter("confirm") != "0" )
289 {
290 confirm = true;
291 std::set<SessionID> sessions = Session::getSessions();
292 std::set<SessionID>::iterator session;
293 for( session = sessions.begin(); session != sessions.end(); ++session )
294 Session::lookupSession( *session )->refresh();
295 copy.removeParameter("confirm");
296 }
297
298 if( confirm )
299 {
300 h << "<META http-equiv='refresh' content=2;URL='" << "/'>";
301 CENTER center(b); center.text();
302 H2 h2(b); h2.text();
303 { A a(b); a.href("/").text("Sessions"); }
304 b << " have been refreshed";
305 }
306 else
307 {
308 { CENTER center(b); center.text();
309 H2 h2(b); h2.text();
310 b << "Are you sure you want to refresh all sessions ?";
311 }
312 { CENTER center(b); center.text();
313 b << "[";
314 { A a(b); a.href(request.toString() + "?confirm=1").text("YES, refresh sessions"); }
315 b << "]" << NBSP << "[";
316 { A a(b); a.href("/").text("NO, do not refresh sessions"); }
317 b << "]";
318 }
319 }
320 }
321 catch( std::exception& e )
322 {
323 b << e.what();
324 }
325}
326
328( const HttpMessage& request, std::stringstream& h, std::stringstream& b )
329{
330 try
331 {
332 HttpMessage copy = request;
333
334 bool confirm = false;
335 if( copy.hasParameter("confirm") && copy.getParameter("confirm") != "0" )
336 {
337 confirm = true;
338 std::set<SessionID> sessions = Session::getSessions();
339 std::set<SessionID>::iterator session;
340 for( session = sessions.begin(); session != sessions.end(); ++session )
341 Session::lookupSession( *session )->logon();
342 copy.removeParameter("confirm");
343 }
344
345 if( confirm )
346 {
347 h << "<META http-equiv='refresh' content=2;URL='" << "/'>";
348 CENTER center(b); center.text();
349 H2 h2(b); h2.text();
350 { A a(b); a.href("/").text("Sessions"); }
351 b << " have been enabled";
352 }
353 else
354 {
355 { CENTER center(b); center.text();
356 H2 h2(b); h2.text();
357 b << "Are you sure you want to enable all sessions ?";
358 }
359 { CENTER center(b); center.text();
360 b << "[";
361 { A a(b); a.href(request.toString() + "?confirm=1").text("YES, enable sessions"); }
362 b << "]" << NBSP << "[";
363 { A a(b); a.href("/").text("NO, do not enable sessions"); }
364 b << "]";
365 }
366 }
367 }
368 catch( std::exception& e )
369 {
370 b << e.what();
371 }
372}
373
375( const HttpMessage& request, std::stringstream& h, std::stringstream& b )
376{
377 try
378 {
379 HttpMessage copy = request;
380
381 bool confirm = false;
382 if( copy.hasParameter("confirm") && copy.getParameter("confirm") != "0" )
383 {
384 confirm = true;
385 std::set<SessionID> sessions = Session::getSessions();
386 std::set<SessionID>::iterator session;
387 for( session = sessions.begin(); session != sessions.end(); ++session )
388 Session::lookupSession( *session )->logout();
389 copy.removeParameter("confirm");
390 }
391
392 if( confirm )
393 {
394 h << "<META http-equiv='refresh' content=2;URL='" << "/'>";
395 CENTER center(b); center.text();
396 H2 h2(b); h2.text();
397 { A a(b); a.href("/").text("Sessions"); }
398 b << " have been disabled";
399 }
400 else
401 {
402 { CENTER center(b); center.text();
403 H2 h2(b); h2.text();
404 b << "Are you sure you want to disable all sessions ?";
405 }
406 { CENTER center(b); center.text();
407 b << "[";
408 { A a(b); a.href(request.toString() + "?confirm=1").text("YES, disable sessions"); }
409 b << "]" << NBSP << "[";
410 { A a(b); a.href("/").text("NO, do not disable sessions"); }
411 b << "]";
412 }
413 }
414 }
415 catch( std::exception& e )
416 {
417 b << e.what();
418 }
419}
420
422( const HttpMessage& request, std::stringstream& h, std::stringstream& b )
423{
424 try
425 {
426 HttpMessage copy = request;
427 std::string url = request.toString();
428 std::string beginString = copy.getParameter( "BeginString" );
429 std::string senderCompID = copy.getParameter( "SenderCompID" );
430 std::string targetCompID = copy.getParameter( "TargetCompID" );
431 std::string sessionQualifier;
432 if( copy.hasParameter("SessionQualifier") )
433 sessionQualifier = copy.getParameter( "SessionQualifier" );
434
435 SessionID sessionID( beginString, senderCompID, targetCompID, sessionQualifier );
436 Session* pSession = Session::lookupSession( sessionID );
437 if( pSession == 0 ) throw SessionNotFound();
438
439 if( copy.hasParameter("Enabled") )
440 {
441 copy.getParameter("Enabled") == "0" ? pSession->logout() : pSession->logon();
442 copy.removeParameter("Enabled");
443 }
444 if( copy.hasParameter("Next%20Incoming") )
445 {
446 int value = IntConvertor::convert( copy.getParameter("Next%20Incoming") );
447 pSession->setNextTargetMsgSeqNum( value <= 0 ? 1 : value );
448 copy.removeParameter("Next%20Incoming");
449 }
450 if( copy.hasParameter("Next%20Outgoing") )
451 {
452 int value = IntConvertor::convert( copy.getParameter("Next%20Outgoing") );
453 pSession->setNextSenderMsgSeqNum( value <= 0 ? 1 : value );
454 copy.removeParameter("Next%20Outgoing");
455 }
457 {
460 }
461 if( copy.hasParameter(CHECK_COMPID) )
462 {
463 pSession->setCheckCompId( copy.getParameter(CHECK_COMPID) != "0" );
465 }
466 if( copy.hasParameter(CHECK_LATENCY) )
467 {
468 pSession->setCheckLatency( copy.getParameter(CHECK_LATENCY) != "0" );
470 }
471 if( copy.hasParameter(MAX_LATENCY) )
472 {
474 pSession->setMaxLatency( value <= 0 ? 1 : value );
476 }
477 if( copy.hasParameter(LOGON_TIMEOUT) )
478 {
480 pSession->setLogonTimeout( value <= 0 ? 1 : value );
482 }
483 if( copy.hasParameter(LOGOUT_TIMEOUT) )
484 {
486 pSession->setLogoutTimeout( value <= 0 ? 1 : value );
488 }
489 if( copy.hasParameter(RESET_ON_LOGON) )
490 {
491 pSession->setResetOnLogon( copy.getParameter(RESET_ON_LOGON) != "0" );
493 }
494 if( copy.hasParameter(RESET_ON_LOGOUT) )
495 {
496 pSession->setResetOnLogout( copy.getParameter(RESET_ON_LOGOUT) != "0" );
498 }
500 {
501 pSession->setResetOnDisconnect( copy.getParameter(RESET_ON_DISCONNECT) != "0" );
503 }
505 {
506 pSession->setRefreshOnLogon( copy.getParameter(REFRESH_ON_LOGON) != "0" );
508 }
510 {
513 }
515 {
516 pSession->setPersistMessages( copy.getParameter(PERSIST_MESSAGES) != "0" );
518 }
519
520 if( url != copy.toString() )
521 h << "<META http-equiv='refresh' content=0;URL='" << copy.toString() << "'>";
522
523 TABLE table(b); table.border(1).cellspacing(2).width(100).text();
524
525 { CAPTION caption(b); caption.text();
526 EM em(b); em.text();
527 b << sessionID;
528 { HR hr(b); hr.text(); }
529 { b << NBSP; A a(b); a.href("/resetSession" + copy.getParameterString()).text("RESET"); }
530 { b << NBSP; A a(b); a.href("/refreshSession" + copy.getParameterString()).text("REFRESH"); }
531 }
532
533 showRow( b, "Enabled", pSession->isEnabled(), url );
534 showRow( b, "ConnectionType", std::string(pSession->isInitiator() ?"initiator" : "acceptor") );
535 showRow( b, "SessionTime", pSession->isSessionTime(UtcTimeStamp()) );
536 showRow( b, "Logged On", pSession->isLoggedOn() );
537 showRow( b, "Next Incoming", (int)pSession->getExpectedTargetNum(), url );
538 showRow( b, "Next Outgoing", (int)pSession->getExpectedSenderNum(), url );
540 showRow( b, CHECK_COMPID, pSession->getCheckCompId(), url );
541 showRow( b, CHECK_LATENCY, pSession->getCheckLatency(), url );
542 showRow( b, MAX_LATENCY, pSession->getMaxLatency(), url );
543 showRow( b, LOGON_TIMEOUT, pSession->getLogonTimeout(), url );
544 showRow( b, LOGOUT_TIMEOUT, pSession->getLogoutTimeout(), url );
545 showRow( b, RESET_ON_LOGON, pSession->getResetOnLogon(), url );
546 showRow( b, RESET_ON_LOGOUT, pSession->getResetOnLogout(), url );
547 showRow( b, RESET_ON_DISCONNECT, pSession->getResetOnDisconnect(), url );
548 showRow( b, REFRESH_ON_LOGON, pSession->getRefreshOnLogon(), url );
550 showRow( b, PERSIST_MESSAGES, pSession->getPersistMessages(), url );
551 }
552 catch( std::exception& e )
553 {
554 b << e.what();
555 }
556}
557
559( const HttpMessage& request, std::stringstream& h, std::stringstream& b )
560{
561 try
562 {
563 HttpMessage copy = request;
564 std::string beginString = request.getParameter( "BeginString" );
565 std::string senderCompID = request.getParameter( "SenderCompID" );
566 std::string targetCompID = request.getParameter( "TargetCompID" );
567 std::string sessionQualifier;
568 if( copy.hasParameter("SessionQualifier") )
569 sessionQualifier = copy.getParameter( "SessionQualifier" );
570
571 SessionID sessionID( beginString, senderCompID, targetCompID, sessionQualifier );
572 Session* pSession = Session::lookupSession( sessionID );
573 if( pSession == 0 ) throw SessionNotFound();
574
575 std::string sessionUrl = "/session" + request.getParameterString();
576
577 bool confirm = false;
578 if( copy.hasParameter("confirm") && copy.getParameter("confirm") != "0" )
579 {
580 confirm = true;
581 pSession->reset();
582 copy.removeParameter("confirm");
583 }
584
585 if( confirm )
586 {
587 h << "<META http-equiv='refresh' content=2;URL='" << "/session" << copy.getParameterString() << "'>";
588 CENTER center(b); center.text();
589 H2 h2(b); h2.text();
590 { A a(b); a.href("/session" + copy.getParameterString()).text(sessionID.toString()); }
591 b << " has been reset";
592 }
593 else
594 {
595 { CENTER center(b); center.text();
596 H2 h2(b); h2.text();
597 b << "Are you sure you want to reset session ";
598 { A a(b); a.href(sessionUrl + request.getParameterString()).text(sessionID.toString()); }
599 b << "?";
600 }
601 { CENTER center(b); center.text();
602 b << "[";
603 { A a(b); a.href(request.toString() + "&confirm=1").text("YES, reset session"); }
604 b << "]" << NBSP << "[";
605 { A a(b); a.href(sessionUrl).text("NO, do not reset session"); }
606 b << "]";
607 }
608 }
609 }
610 catch( std::exception& e )
611 {
612 b << e.what();
613 }
614}
615
617( const HttpMessage& request, std::stringstream& h, std::stringstream& b )
618{
619 try
620 {
621 HttpMessage copy = request;
622 std::string beginString = request.getParameter( "BeginString" );
623 std::string senderCompID = request.getParameter( "SenderCompID" );
624 std::string targetCompID = request.getParameter( "TargetCompID" );
625 std::string sessionQualifier;
626 if( copy.hasParameter("SessionQualifier") )
627 sessionQualifier = copy.getParameter( "SessionQualifier" );
628
629 SessionID sessionID( beginString, senderCompID, targetCompID, sessionQualifier );
630 Session* pSession = Session::lookupSession( sessionID );
631 if( pSession == 0 ) throw SessionNotFound();
632
633 std::string sessionUrl = "/session" + request.getParameterString();
634
635 bool confirm = false;
636 if( copy.hasParameter("confirm") && copy.getParameter("confirm") != "0" )
637 {
638 confirm = true;
639 pSession->refresh();
640 copy.removeParameter("confirm");
641 }
642
643 if( confirm )
644 {
645 h << "<META http-equiv='refresh' content=2;URL='" << "/session" << copy.getParameterString() << "'>";
646 CENTER center(b); center.text();
647 H2 h2(b); h2.text();
648 { A a(b); a.href("/session" + copy.getParameterString()).text(sessionID.toString()); }
649 b << " has been refreshed";
650 }
651 else
652 {
653 { CENTER center(b); center.text();
654 H2 h2(b); h2.text();
655 b << "Are you sure you want to refresh session ";
656 { A a(b); a.href(sessionUrl + request.getParameterString()).text(sessionID.toString()); }
657 b << "?";
658 }
659 { CENTER center(b); center.text();
660 b << "[";
661 { A a(b); a.href(request.toString() + "&confirm=1").text("YES, refresh session"); }
662 b << "]" << NBSP << "[";
663 { A a(b); a.href(sessionUrl).text("NO, do not refresh session"); }
664 b << "]";
665 }
666 }
667 }
668 catch( std::exception& e )
669 {
670 b << e.what();
671 }
672}
673
675( std::stringstream& s, const std::string& name, bool value, const std::string& url )
676{
677 { TR tr(s); tr.text();
678 { TD td(s); td.text(name); }
679 { TD td(s); td.text(value ? "yes" : "no"); }
680 { TD td(s); td.text();
681 CENTER center(s); center.text();
682 if( url.size() )
683 {
684 std::stringstream href;
685 href << url << "&" << name << "=" << !value;
686 A a(s); a.href(href.str()).text("toggle");
687 }
688 }
689 }
690}
691
693( std::stringstream& s, const std::string& name, const std::string& value, const std::string& url )
694{
695 { TR tr(s); tr.text();
696 { TD td(s); td.text(name); }
697 { TD td(s); td.text(value); }
698 { TD td(s); td.text();
699 CENTER center(s); center.text();
700 }
701 }
702}
703
705( std::stringstream& s, const std::string& name, int value, const std::string& url )
706{
707 { TR tr(s); tr.text();
708 { TD td(s); td.text(name); }
709 { TD td(s); td.text(value); }
710 { TD td(s); td.text();
711 CENTER center(s); center.text();
712 {
713 std::stringstream href;
714 href << url << "&" << name << "=" << value - 10;
715 A a(s); a.href(href.str()).text("<<");
716 }
717 s << NBSP;
718 {
719 std::stringstream href;
720 href << url << "&" << name << "=" << value - 1;
721 A a(s); a.href(href.str()).text("<");
722 }
723 s << NBSP << "|" << NBSP;
724 {
725 std::stringstream href;
726 href << url << "&" << name << "=" << value + 1;
727 A a(s); a.href(href.str()).text(">");
728 }
729 s << NBSP;
730 {
731 std::stringstream href;
732 href << url << "&" << name << "=" << value + 10;
733 A a(s); a.href(href.str()).text(">>");
734 }
735 }
736 }
737}
738
739} // namespace FIX
void processRoot(const HttpMessage &, std::stringstream &h, std::stringstream &b)
void processDisableSessions(const HttpMessage &, std::stringstream &h, std::stringstream &b)
void processRefreshSession(const HttpMessage &, std::stringstream &h, std::stringstream &b)
void processEnableSessions(const HttpMessage &, std::stringstream &h, std::stringstream &b)
void processResetSession(const HttpMessage &, std::stringstream &h, std::stringstream &b)
void processRequest(const HttpMessage &)
void processSession(const HttpMessage &, std::stringstream &h, std::stringstream &b)
char m_buffer[BUFSIZ]
bool readMessage(std::string &msg)
void disconnect(int error=0)
bool send(const std::string &)
void processResetSessions(const HttpMessage &, std::stringstream &h, std::stringstream &b)
void showRow(std::stringstream &s, const std::string &name, bool value, const std::string &url="")
void processRefreshSessions(const HttpMessage &, std::stringstream &h, std::stringstream &b)
HTTP Message that implemented GET functionality.
Definition HttpMessage.h:38
const std::string & getRootString() const
Definition HttpMessage.h:73
const std::string & getParameter(const std::string &key) const
Definition HttpMessage.h:97
std::string toString() const
Get a string representation of the message.
bool hasParameter(const std::string &key) const
Definition HttpMessage.h:91
static std::string createResponse(int error=0, const std::string &text="")
const std::string getParameterString() const
Definition HttpMessage.h:76
void removeParameter(const std::string &key)
void addToStream(const char *str, size_t len)
Definition HttpParser.h:45
Maintains the state and implements the logic of a FIX session.
Definition Session.h:46
bool getMillisecondsInTimeStamp()
Definition Session.h:182
void setResetOnLogon(bool value)
Definition Session.h:164
void setSendRedundantResendRequests(bool value)
Definition Session.h:134
bool getCheckCompId()
Definition Session.h:137
void setResetOnLogout(bool value)
Definition Session.h:169
void setMillisecondsInTimeStamp(bool value)
Definition Session.h:184
bool getSendRedundantResendRequests()
Definition Session.h:132
bool getResetOnLogout()
Definition Session.h:167
void logout(const std::string &reason="")
Definition Session.h:57
int getMaxLatency()
Definition Session.h:147
void setMaxLatency(int value)
Definition Session.h:149
bool getPersistMessages()
Definition Session.h:200
void reset()
Definition Session.h:66
void setNextSenderMsgSeqNum(int num)
Definition Session.h:70
bool isEnabled()
Definition Session.h:59
int getExpectedTargetNum()
Definition Session.h:225
int getLogonTimeout()
Definition Session.h:152
bool isSessionTime(const UtcTimeStamp &time)
Definition Session.h:108
static Session * lookupSession(const SessionID &)
Definition Session.cpp:1496
void setCheckLatency(bool value)
Definition Session.h:144
int getLogoutTimeout()
Definition Session.h:157
void setRefreshOnLogon(bool value)
Definition Session.h:179
void setResetOnDisconnect(bool value)
Definition Session.h:174
bool isInitiator()
Definition Session.h:112
void refresh()
Definition Session.h:68
bool getResetOnLogon()
Definition Session.h:162
bool getResetOnDisconnect()
Definition Session.h:172
void logon()
Definition Session.h:55
int getExpectedSenderNum()
Definition Session.h:224
void setPersistMessages(bool value)
Definition Session.h:202
void setCheckCompId(bool value)
Definition Session.h:139
static std::set< SessionID > getSessions()
Definition Session.cpp:1485
void setNextTargetMsgSeqNum(int num)
Definition Session.h:72
bool isLoggedOn()
Definition Session.h:65
bool getCheckLatency()
Definition Session.h:142
void setLogonTimeout(int value)
Definition Session.h:154
static size_t numSessions()
Definition Session.cpp:1553
bool getRefreshOnLogon()
Definition Session.h:177
void setLogoutTimeout(int value)
Definition Session.h:159
Unique session id consists of BeginString, SenderCompID and TargetCompID.
Definition SessionID.h:31
std::string toString() const
Get a string representation of the SessionID.
Definition SessionID.h:65
Date and Time represented in UTC.
Definition FieldTypes.h:583
A & href(const std::string &value)
Definition HtmlBuilder.h:78
TABLE & cellspacing(int value)
TABLE & border(int value)
TABLE & width(int value)
TAG & text()
Definition HtmlBuilder.h:48
TD & align(const std::string &value)
const char LOGOUT_TIMEOUT[]
const char LOGON_TIMEOUT[]
const char SEND_REDUNDANT_RESENDREQUESTS[]
const char CHECK_COMPID[]
ssize_t socket_recv(int s, char *buf, size_t length)
Definition Utility.cpp:170
void socket_close(int s)
Definition Utility.cpp:180
const char REFRESH_ON_LOGON[]
const char RESET_ON_LOGOUT[]
const char CHECK_LATENCY[]
ssize_t socket_send(int s, const char *msg, size_t length)
Definition Utility.cpp:175
const char RESET_ON_LOGON[]
const char PERSIST_MESSAGES[]
const char RESET_ON_DISCONNECT[]
const char MAX_LATENCY[]
const char MILLISECONDS_IN_TIMESTAMP[]
const char * NBSP
static std::string convert(signed_int value)
Not a recognizable message.
Definition Exceptions.h:81
Unable to parse message.
Definition Exceptions.h:74
Session cannot be found for specified action.
Definition Exceptions.h:232
Socket recv operation failed.
Definition Exceptions.h:279

Generated on Mon Oct 14 2024 06:04:44 for QuickFIX by doxygen 1.9.8 written by Dimitri van Heesch, © 1997-2001