66 if( m_handler !=
nullptr )
67 (m_handler->*method)() ;
71 if( m_es_saved.set() )
72 m_es_saved.call( e ,
true ) ;
76 catch( std::exception & e )
78 if( m_es_saved.set() )
79 m_es_saved.call( e ,
false ) ;
85void GNet::EventEmitter::raiseEvent(
void (EventHandler::*method)(EventHandler::Reason) ,
86 Descriptor , EventHandler::Reason reason )
88 EventLoggingContext set_logging_context( m_handler && m_es.set() ? m_es.esrc() :
nullptr ) ;
92 if( m_handler !=
nullptr )
93 (m_handler->*method)( reason ) ;
97 if( m_es_saved.set() )
98 m_es_saved.call( e ,
true ) ;
102 catch( std::exception & e )
104 if( m_es_saved.set() )
105 m_es_saved.call( e ,
false ) ;
113 m_handler = nullptr ;
118 if( m_es.eh() == eh )
120 if( m_es_saved.eh() == eh )
A class that encapsulates a network socket file descriptor and an associated windows event handle.
An exception class that is detected by GNet::EventHandlerList and results in onException() being call...
An EventHandler and ExceptionSink tuple, with methods to raise an event and handle any exceptions.
void raiseWriteEvent(Descriptor)
Calls the EventHandler writeEvent() method.
void update(EventHandler *, ExceptionSink) noexcept
Sets the event handler and the exception sink.
void reset() noexcept
Resets the EventHandler so that the raise methods do nothing.
void raiseReadEvent(Descriptor)
Calls the EventHandler readEvent() method.
void disarm(ExceptionHandler *) noexcept
If the exception handler matches then reset it so that it is not called.
EventEmitter() noexcept
Default constructor.
void raiseOtherEvent(Descriptor, EventHandler::Reason)
Calls the EventHandler otherEvent() method.
A base class for classes that have a file descriptor and handle asynchronous events from the event lo...
virtual void readEvent()
Called for a read event.
virtual void writeEvent()
Called for a write event.
virtual void otherEvent(Reason)
Called for a socket-exception event, or a socket-close event on windows.
A class that sets the G::LogOuput::context() while in scope.
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket/future event...
A tuple containing an ExceptionHandler interface pointer and a bound 'exception source' pointer.