svn cleanup
[anytun.git] / syncSocketHandler.cpp
blob25f4c434ff8ce9b759bd9fb0bc266222b71137b9
1 //#include <sstream>
2 //#include <iostream>
3 //#include <string>
4 //
5 //#include <boost/archive/text_oarchive.hpp>
6 //#include <boost/archive/text_iarchive.hpp>
9 //#include "connectionParam.h"
10 //#include "Sockets/Utility.h"
11 #include "syncSocketHandler.h"
12 #include "syncListenSocket.h"
13 #include "syncSocket.h"
14 #include "connectionList.h"
15 //#include "buffer.h"
16 //#include "log.h"
18 SyncSocketHandler::SyncSocketHandler(SyncQueue & queue)
19 :SocketHandler(),queue_(queue)
23 int SyncSocketHandler::Select(long sec,long usec)
25 if(!queue_.empty())
27 std::string sendstr = queue_.pop();
28 for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end(); it++)
30 ::SOCKETS_NAMESPACE::Socket *p = (*it).second;
31 TcpSocket *p3 = dynamic_cast<TcpSocket *>(p);
32 //SyncListenSocket<SyncSocket,ConnectionList> *p4 = dynamic_cast<SyncListenSocket<SyncSocket,ConnectionList> *>(p);
33 if (p3)
34 p3->Send(sendstr);
37 return SocketHandler::Select(sec,usec);