|
xrootd
|
A poller implementation using the build-in XRootD poller. More...
#include <XrdClPollerBuiltIn.hh>


Public Member Functions | |
| PollerBuiltIn () | |
| Constructor. | |
| virtual bool | Initialize () |
| Initialize the poller. | |
| virtual bool | Finalize () |
| Finalize the poller. | |
| virtual bool | Start () |
| Start polling. | |
| virtual bool | Stop () |
| Stop polling. | |
| virtual bool | AddSocket (Socket *socket, SocketHandler *handler) |
| virtual bool | RemoveSocket (Socket *socket) |
| Remove the socket. | |
| 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. | |
| virtual bool | IsRunning () const |
| Is the event loop running? | |
Private Types | |
| typedef std::map< Socket *, void * > | SocketMap |
Private Attributes | |
| SocketMap | pSocketMap |
| XrdSys::IOEvents::Poller * | pPoller |
| XrdSysMutex | pMutex |
A poller implementation using the build-in XRootD poller.
typedef std::map<Socket *, void *> XrdCl::PollerBuiltIn::SocketMap [private] |
| XrdCl::PollerBuiltIn::PollerBuiltIn | ( | ) | [inline] |
Constructor.
| bool XrdCl::PollerBuiltIn::AddSocket | ( | Socket * | socket, |
| SocketHandler * | handler | ||
| ) | [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::Socket::GetFD(), XrdCl::DefaultEnv::GetLog(), XrdCl::Socket::GetName(), XrdCl::Socket::GetStatus(), XrdCl::SocketHandler::Initialize(), pMutex, XrdCl::PollerMsg, pPoller, pSocketMap, and XrdCl::Log::Warning().
| bool XrdCl::PollerBuiltIn::EnableReadNotification | ( | Socket * | socket, |
| bool | notify, | ||
| uint16_t | timeout = 60 |
||
| ) | [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::DefaultEnv::GetLog(), XrdCl::Socket::GetName(), pMutex, XrdCl::PollerMsg, and pSocketMap.
| bool XrdCl::PollerBuiltIn::EnableWriteNotification | ( | Socket * | socket, |
| bool | notify, | ||
| uint16_t | timeout = 60 |
||
| ) | [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::DefaultEnv::GetLog(), XrdCl::Socket::GetName(), pMutex, XrdCl::PollerMsg, and pSocketMap.
| bool XrdCl::PollerBuiltIn::Finalize | ( | ) | [virtual] |
| bool XrdCl::PollerBuiltIn::Initialize | ( | ) | [virtual] |
Initialize the poller.
Implements XrdCl::Poller.
| bool XrdCl::PollerBuiltIn::IsRegistered | ( | Socket * | socket | ) | [virtual] |
Check whether the socket is registered with the poller.
Implements XrdCl::Poller.
References pMutex, and pSocketMap.
| virtual bool XrdCl::PollerBuiltIn::IsRunning | ( | ) | const [inline, virtual] |
| bool XrdCl::PollerBuiltIn::RemoveSocket | ( | Socket * | socket | ) | [virtual] |
Remove the socket.
Implements XrdCl::Poller.
References XrdCl::DefaultEnv::GetLog(), XrdCl::Socket::GetName(), pMutex, XrdCl::PollerMsg, and pSocketMap.
| bool XrdCl::PollerBuiltIn::Start | ( | ) | [virtual] |
Start polling.
Implements XrdCl::Poller.
References Create, XrdCl::DefaultEnv::GetLog(), XrdCl::PollerMsg, pPoller, and pSocketMap.
| bool XrdCl::PollerBuiltIn::Stop | ( | ) | [virtual] |
Stop polling.
Implements XrdCl::Poller.
References XrdCl::Log::Debug(), XrdCl::DefaultEnv::GetLog(), XrdCl::PollerMsg, pPoller, and XrdSys::IOEvents::Poller::Stop().
XrdSysMutex XrdCl::PollerBuiltIn::pMutex [private] |
Referenced by AddSocket(), EnableReadNotification(), EnableWriteNotification(), IsRegistered(), and RemoveSocket().
Referenced by AddSocket(), IsRunning(), Start(), and Stop().
SocketMap XrdCl::PollerBuiltIn::pSocketMap [private] |
Referenced by AddSocket(), EnableReadNotification(), EnableWriteNotification(), Finalize(), IsRegistered(), RemoveSocket(), and Start().
1.7.6.1