#include <sockets.h>
Inherits Socket.
Inherited by DBFlatFile, DBMySQL, DBSQL, ModePipe, ModuleLDAP, ModuleSQL, and Thread.

Public Member Functions | |
| Pipe () | |
| ~Pipe () | |
| bool | ProcessRead () anope_override |
| void | Write (const char *data, size_t sz) |
| void | Write (const Anope::string &data) |
| int | Read (char *data, size_t sz) |
| bool | SetWriteBlocking (bool state) |
| void | Notify () |
| virtual void | OnNotify ()=0 |
Data Fields | |
| int | write_pipe |
Definition at line 453 of file sockets.h.
| Pipe::Pipe | ( | ) |
Definition at line 20 of file pipeengine.cpp.
References anope_close, SocketEngine::Change(), SocketIO::Destroy(), F_GETFL, F_SETFL, fcntl(), Socket::io, Anope::LastError(), O_NONBLOCK, pipe(), SF_READABLE, SF_WRITABLE, Socket::sock, SocketEngine::Sockets, and write_pipe.
| Pipe::~Pipe | ( | ) |
Definition at line 43 of file pipeengine.cpp.
References anope_close, and write_pipe.
| void Pipe::Notify | ( | ) |
Called when this pipe needs to be woken up Is the same as Write("\0", 1)
Definition at line 77 of file pipeengine.cpp.
References Write().
Referenced by DBFlatFile::OnSaveDatabase(), LDAPService::Run(), Thread::SetExitState(), and ModeManager::StackerAdd().
| virtual void Pipe::OnNotify | ( | ) | [pure virtual] |
Called after ProcessRead comes back from Notify(), overload to do something useful
Implemented in DBFlatFile, DBSQL, DBMySQL, ModuleLDAP, ModuleSQL, and ModePipe.
Referenced by ProcessRead().
| bool Pipe::ProcessRead | ( | ) | [virtual] |
Called when data is to be read, reads the data then calls OnNotify
Reimplemented from Socket.
Definition at line 49 of file pipeengine.cpp.
References Socket::GetFD(), OnNotify(), and read.
| int Pipe::Read | ( | char * | data, | |
| size_t | sz | |||
| ) |
Read data from this pipe
| data | A buffer to read data into | |
| sz | The size of the buffer |
Definition at line 63 of file pipeengine.cpp.
References Socket::GetFD(), and read.
Referenced by DBFlatFile::OnNotify().
| bool Pipe::SetWriteBlocking | ( | bool | state | ) |
Mark the write end of this pipe (non)blocking
| state | true to enable blocking, false to disable blocking |
Definition at line 68 of file pipeengine.cpp.
References F_GETFL, F_SETFL, fcntl(), O_NONBLOCK, and write_pipe.
| void Pipe::Write | ( | const Anope::string & | data | ) | [inline] |
| void Pipe::Write | ( | const char * | data, | |
| size_t | sz | |||
| ) |
Write data to this pipe
| data | The data to write | |
| sz | The amount of data to wirite |
Definition at line 58 of file pipeengine.cpp.
References write, and write_pipe.
Referenced by Notify(), and DBFlatFile::OnSaveDatabase().
| int Pipe::write_pipe |
1.7.1