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