RTFX  0.3
Real time special effects collaborative visualization and production library.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
RTFXServer.h
Go to the documentation of this file.
1 #ifndef __RTFX_SERVER__
2 #define __RTFX_SERVER__
3 
21 #include <algorithm>
22 #include <cstdlib>
23 #include <deque>
24 #include <iostream>
25 #include <list>
26 #include <set>
27 #include <boost/bind.hpp>
28 #include <boost/shared_ptr.hpp>
29 #include <boost/enable_shared_from_this.hpp>
30 #include <boost/asio.hpp>
31 
32 #include "RTFXDebug.h"
33 
34 #include "RTFXPostOffice.h"
35 #include "RTFXSession.h"
36 
37 using boost::asio::ip::tcp;
38 
39 namespace RTFX
40 {
41  typedef boost::shared_ptr<RTFXSession> RTFXSessionPtr;
42 
45  class RTFXAPI RTFXServer
46  {
47  public:
49  RTFXServer();
50 
52  RTFXServer( boost::asio::io_service &_ioService, const tcp::endpoint &_endpoint );
53 
55  void StartAccepting();
56 
58  void HandleAccept( RTFXSessionPtr _session, const boost::system::error_code &_error );
59 
61  RTFXPostOffice * GetPostOfficePtr() { return &postOffice; }
62 
64  boost::asio::io_service * GetIOService() { return &ioService; }
65 
67  void SetDefaultCompressionType( COMPRESSIONTYPE _value )
68  {
69  compressionType = _value;
70  postOffice.SetDefaultCompressionType( _value );
71  }
72 
73  private:
74 
77 
79  boost::asio::io_service& ioService;
80 
82  tcp::acceptor acceptor;
83 
86  };
87 }
88 
89 #endif