|
UniSet
2.6.0
|
00001 // ------------------------------------------------------------------------- 00002 #ifndef UTCPSocket_H_ 00003 #define UTCPSocket_H_ 00004 // ------------------------------------------------------------------------- 00005 #include <string> 00006 #include <Poco/Net/ServerSocket.h> 00007 #include "PassiveTimer.h" // for timeout_t 00008 // ------------------------------------------------------------------------- 00009 namespace uniset 00010 { 00011 00012 class UTCPSocket: 00013 public Poco::Net::ServerSocket 00014 { 00015 public: 00016 00017 UTCPSocket(); 00018 00019 // dup and accept...raw socket 00020 UTCPSocket( int sock ); 00021 00022 UTCPSocket( const std::string& host, int port ); 00023 00024 virtual ~UTCPSocket(); 00025 00026 // set keepalive params 00027 // return true if OK 00028 bool setKeepAliveParams( timeout_t timeout_sec = 5, int conn_keepcnt = 1, int keepintvl = 2 ); 00029 00030 int getSocket() noexcept; 00031 00032 protected: 00033 void init(); 00034 00035 private: 00036 00037 }; 00038 // ------------------------------------------------------------------------- 00039 } // end of uniset namespace 00040 // ------------------------------------------------------------------------- 00041 #endif // UTCPSocket_H_ 00042 // -------------------------------------------------------------------------
1.7.6.1