InspIRCd
3.0
|
#include <inspsocket.h>
Classes | |
class | SendQueue |
Public Member Functions | |
IOHook * | GetIOHook () const |
void | AddIOHook (IOHook *hook) |
void | DelIOHook () |
void | DoWrite () |
void | OnEventHandlerRead () CXX11_OVERRIDE |
void | OnEventHandlerWrite () CXX11_OVERRIDE |
void | OnEventHandlerError (int errcode) CXX11_OVERRIDE |
void | SetError (const std::string &err) |
const std::string & | getError () const |
virtual void | OnDataReady ()=0 |
virtual void | OnError (BufferedSocketError e)=0 |
void | WriteData (const std::string &data) |
bool | GetNextLine (std::string &line, char delim='\n') |
size_t | getSendQSize () const |
SendQueue & | GetSendQ () |
virtual void | Close () |
CullResult | cull () CXX11_OVERRIDE |
IOHook * | GetModHook (Module *mod) const |
![]() | |
int | GetFd () const |
int | GetEventMask () const |
void | SetFd (int FD) |
EventHandler () | |
virtual | ~EventHandler () |
Protected Attributes | |
std::string | recvq |
![]() | |
int | fd |
StreamSocket is a class that wraps a TCP socket and handles send and receive queues, including passing them to IO hooks
|
virtual |
Close the socket, remove from socket engine, etc
|
virtual |
This ensures that close is called prior to destructor
Reimplemented from classbase.
void StreamSocket::DoWrite | ( | ) |
Flush the send queue
|
inline |
Gets the error message for this socket.
bool StreamSocket::GetNextLine | ( | std::string & | line, |
char | delim = '\n' |
||
) |
Convenience function: read a line from the socket
line | The line read |
delim | The line delimiter |
size_t StreamSocket::getSendQSize | ( | ) | const |
Useful for implementing sendq exceeded
|
pure virtual |
Called when new data is present in recvq
Implemented in UserIOHandler, BufferedSocket, and ThreadSignalSocket.
|
pure virtual |
Called when the socket gets an error from socket engine or IO hook
Implemented in UserIOHandler, and ThreadSignalSocket.
|
virtual |
Called by the socket engine on error
errcode | Error |
Reimplemented from EventHandler.
Reimplemented in ThreadSignalSocket.
|
virtual |
Called by the socket engine on a read event
Implements EventHandler.
Reimplemented in ThreadSignalSocket.
|
virtual |
Called by the socket engine on a write event
Reimplemented from EventHandler.
Reimplemented in BufferedSocket, and ThreadSignalSocket.
|
inline |
Sets the error message for this socket. Once set, the socket is dead.
void StreamSocket::WriteData | ( | const std::string & | data | ) |
Send the given data out the socket, either now or when writes unblock