|
xrootd
|
A poller implementation using libEvent underneath. More...
#include <XrdClPollerLibEvent.hh>


Public Member Functions | |
| PollerLibEvent () | |
| Constructor. More... | |
| virtual bool | Initialize () |
| Initialize the poller. More... | |
| virtual bool | Finalize () |
| Finalize the poller. More... | |
| virtual bool | Start () |
| Start polling. More... | |
| virtual bool | Stop () |
| Stop polling. More... | |
| virtual bool | AddSocket (Socket *socket, SocketHandler *handler) |
| virtual bool | RemoveSocket (Socket *socket) |
| Remove the socket. More... | |
| virtual bool | EnableReadNotification (Socket *socket, bool notify, uint16_t timeout=60) |
| virtual bool | EnableWriteNotification (Socket *socket, bool notify, uint16_t timeout=60) |
| virtual bool | IsRegistered (Socket *socket) |
| Check whether the socket is registered with the poller. More... | |
| virtual bool | IsRunning () const |
| Is the event loop running? More... | |
| int | RunEventLoop () |
| Run the libevent event loop. More... | |
Public Member Functions inherited from XrdCl::Poller | |
| virtual | ~Poller () |
| Destructor. More... | |
Private Types | |
| typedef std::map< const Socket *, void * > | SocketMap |
Private Attributes | |
| SocketMap | pSocketMap |
| XrdSysMutex | pMutex |
| event_base * | pEventBase |
| pthread_t | pPollerThread |
| bool | pPollerThreadRunning |
A poller implementation using libEvent underneath.
|
private |
|
inline |
Constructor.
|
virtual |
Add socket to the polling loop
| socket | the socket |
| handler | object handling the events |
Implements XrdCl::Poller.
References XrdCl::Socket::Connected, XrdCl::Socket::Connecting, XrdCl::Log::Debug(), XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), XrdCl::Socket::GetName(), XrdCl::Socket::GetStatus(), XrdCl::SocketHandler::Initialize(), pMutex, XrdCl::PollerMsg, pSocketMap, and XrdCl::Log::Warning().
|
virtual |
Notify the handler about read events
| socket | the socket |
| notify | specify if the handler should be notified |
| timeout | if no read event occurred after this time a timeout event will be generated |
Implements XrdCl::Poller.
References XrdCl::Log::Dump(), XrdCl::Log::Error(), XrdCl::Socket::GetFD(), XrdCl::DefaultEnv::GetLog(), XrdCl::Socket::GetName(), pEventBase, pMutex, XrdCl::PollerMsg, pSocketMap, ReadEventCallback(), and XrdCl::Log::Warning().
|
virtual |
Notify the handler about write events
| socket | the socket |
| notify | specify if the handler should be notified |
| timeout | if no write event occurred after this time a timeout event will be generated |
Implements XrdCl::Poller.
References XrdCl::Log::Dump(), XrdCl::Log::Error(), XrdCl::Socket::GetFD(), XrdCl::DefaultEnv::GetLog(), XrdCl::Socket::GetName(), pEventBase, pMutex, XrdCl::PollerMsg, pSocketMap, XrdCl::Log::Warning(), and WriteEventCallback().
|
virtual |
Finalize the poller.
Implements XrdCl::Poller.
References IsRunning(), pEventBase, pSocketMap, and Stop().
|
virtual |
Initialize the poller.
Implements XrdCl::Poller.
References XrdCl::Log::Debug(), XrdCl::Log::Dump(), XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), HandleLogMessage(), pEventBase, and XrdCl::PollerMsg.
|
virtual |
Check whether the socket is registered with the poller.
Implements XrdCl::Poller.
References pMutex, and pSocketMap.
|
inlinevirtual |
Is the event loop running?
Implements XrdCl::Poller.
References pPollerThreadRunning.
Referenced by Finalize().
|
virtual |
Remove the socket.
Implements XrdCl::Poller.
References XrdCl::Log::Debug(), XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), XrdCl::Socket::GetName(), pMutex, XrdCl::PollerMsg, and pSocketMap.
| int XrdCl::PollerLibEvent::RunEventLoop | ( | ) |
Run the libevent event loop.
References close(), XrdCl::Log::Debug(), DummyCallback(), XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), XrdSysMutexHelper::Lock(), pEventBase, pMutex, XrdCl::PollerMsg, and XrdSysMutexHelper::UnLock().
Referenced by RunPollerThread().
|
virtual |
Start polling.
Implements XrdCl::Poller.
References XrdCl::Log::Debug(), XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), XrdCl::PollerMsg, pPollerThread, pPollerThreadRunning, and RunPollerThread().
|
virtual |
Stop polling.
Implements XrdCl::Poller.
References XrdCl::Log::Debug(), XrdCl::Log::Dump(), XrdCl::Log::Error(), XrdCl::DefaultEnv::GetLog(), pEventBase, XrdCl::PollerMsg, pPollerThread, and pPollerThreadRunning.
Referenced by Finalize().
|
private |
Referenced by EnableReadNotification(), EnableWriteNotification(), Finalize(), Initialize(), RunEventLoop(), and Stop().
|
private |
Referenced by AddSocket(), EnableReadNotification(), EnableWriteNotification(), IsRegistered(), RemoveSocket(), and RunEventLoop().
|
private |
Referenced by IsRunning(), Start(), and Stop().
|
private |
Referenced by AddSocket(), EnableReadNotification(), EnableWriteNotification(), Finalize(), IsRegistered(), and RemoveSocket().
1.8.3.1