32 G_DEBUG(
"GNet::EventHandler::readEvent: no override" ) ;
37 G_DEBUG(
"GNet::EventHandler::writeEvent: no override" ) ;
47 throw G::Exception(
"socket disconnect event" , str(reason) ) ;
52 if( reason == EventHandler::reason_closed )
return "closed" ;
53 if( reason == EventHandler::reason_down )
return "network down" ;
54 if( reason == EventHandler::reason_reset )
return "connection reset by peer" ;
55 if( reason == EventHandler::reason_abort )
return "connection aborted" ;
56 return std::string() ;
virtual void readEvent()
Called for a read event.
virtual void writeEvent()
Called for a write event.
static std::string str(Reason)
Returns a printable description of the other-event reason.
A general-purpose exception class derived from std::exception and containing a std::string.
virtual void otherEvent(Reason)
Called for a socket-exception event or a socket-close event on windows.
virtual ~EventHandler()
Destructor.