UniSet  2.24.2
USocket.h
1 // -------------------------------------------------------------------------
2 #ifndef USocket_H_
3 #define USocket_H_
4 // -------------------------------------------------------------------------
5 #include <Poco/Net/Socket.h>
6 #include "PassiveTimer.h" // fot timeout_t
7 // -------------------------------------------------------------------------
8 namespace uniset
9 {
10  // класс обёртка, понадобился только для того, чтобы достучаться до "сырого" сокета
11  // и иметь возможность использовать его с libev
12  class USocket:
13  public Poco::Net::Socket
14  {
15  public:
16 
17  USocket();
18  virtual ~USocket();
19 
20  // set keepalive params
21  // return true if OK
22  bool setKeepAliveParams( timeout_t timeout_sec = 5, int conn_keepcnt = 1, int keepintvl = 2 );
23 
24  int getSocket();
25 
26  protected:
27  void init( bool throwflag = false );
28 
29  private:
30 
31  };
32  // -------------------------------------------------------------------------
33 } // end of uniset namespace
34 // -------------------------------------------------------------------------
35 #endif // USocket_H_
36 // -------------------------------------------------------------------------
Definition: USocket.h:14
Definition: CommonEventLoop.h:15