length to size
[anytun.git] / syncConnectionCommand.h
blob225ec9c9811caab08840cf751eb2219c4ec1f3d5
1 #ifndef _SYNCCONNECTIONCOMMAND_H
2 #define _SYNCCONNECTIONCOMMAND_H
3 #include <boost/archive/text_oarchive.hpp>
4 #include <boost/archive/text_iarchive.hpp>
6 #include "connectionList.h"
7 #include "threadUtils.hpp"
9 class SyncConnectionCommand
11 public:
12 SyncConnectionCommand(ConnectionList & cl );
13 SyncConnectionCommand(ConnectionList & cl ,u_int16_t mux);
14 u_int16_t getMux() const;
16 private:
17 SyncConnectionCommand(const SyncConnectionCommand &);
18 ConnectionList & cl_;
19 u_int16_t mux_;
20 friend class boost::serialization::access;
21 template<class Archive>
22 void serialize(Archive & ar, const unsigned int version)
24 Lock lock(cl_.getMutex());
25 ar & mux_;
26 ConnectionParam & conn = cl_.getOrNewConnectionUnlocked(mux_);
27 ar & conn;
32 #endif // _SYNCCOMMAND_H