OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
xmpp_connection_manager.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
3  */
4 
5 #ifndef XMPP_XMPP_CONNECTION_MANAGER_H
6 #define XMPP_XMPP_CONNECTION_MANAGER_H
7 
8 #include "base/queue_task.h"
9 #include "io/ssl_server.h"
10 
11 class LifetimeActor;
12 class XmppSession;
13 
14 //
15 // Common class to represent XmppClient and XmppServer
16 //
18 public:
20  boost::asio::ssl::context::method m,
21  bool ssl_enabled, bool ssl_handshake_delayed);
22 
23  void Shutdown();
24  void EnqueueSession(XmppSession *session);
25  size_t GetSessionQueueSize() const;
26  virtual LifetimeActor *deleter() = 0;
27  tbb::mutex &mutex() const { return mutex_; }
28 
29 private:
30  bool DequeueSession(TcpSessionPtr tcp_session);
31  void WorkQueueExitCallback(bool done);
32 
34  mutable tbb::mutex mutex_;
35 
37 };
38 
39 #endif // XMPP_XMPP_CONNECTION_MANAGER_H
virtual LifetimeActor * deleter()=0
XmppConnectionManager(EventManager *evm, boost::asio::ssl::context::method m, bool ssl_enabled, bool ssl_handshake_delayed)
tbb::mutex & mutex() const
boost::intrusive_ptr< HttpClientSession > TcpSessionPtr
Definition: http_curl.cc:105
void EnqueueSession(XmppSession *session)
void WorkQueueExitCallback(bool done)
DISALLOW_COPY_AND_ASSIGN(XmppConnectionManager)
bool DequeueSession(TcpSessionPtr tcp_session)
WorkQueue< TcpSessionPtr > session_queue_
static EventManager evm