InspIRCd  3.0
Public Member Functions | Public Attributes | List of all members
IOHook Class Referenceabstract
Inheritance diagram for IOHook:
classbase IOHookMiddle

Public Member Functions

 IOHook (IOHookProvider *provider)
virtual int OnStreamSocketWrite (StreamSocket *sock, StreamSocket::SendQueue &sendq)=0
virtual void OnStreamSocketClose (StreamSocket *sock)=0
virtual int OnStreamSocketRead (StreamSocket *sock, std::string &recvq)=0
- Public Member Functions inherited from classbase
virtual CullResult cull ()

Public Attributes

IOHookProvider *const prov

Constructor & Destructor Documentation

◆ IOHook()

IOHook::IOHook ( IOHookProvider provider)


providerIOHookProvider that creates this object

Member Function Documentation

◆ OnStreamSocketClose()

virtual void IOHook::OnStreamSocketClose ( StreamSocket sock)
pure virtual

Called immediately before the hooked socket is closed. When this event is called, shutdown() has not yet been called on the socket.

sockHooked socket

◆ OnStreamSocketRead()

virtual int IOHook::OnStreamSocketRead ( StreamSocket sock,
std::string &  recvq 
pure virtual

Called when the hooked socket has data to read

sockHooked socket
recvqThe receive queue that new data should be appended to
1 if new data has been read, 0 if no new data is ready (but the socket is still connected), -1 if there was an error or close

◆ OnStreamSocketWrite()

virtual int IOHook::OnStreamSocketWrite ( StreamSocket sock,
StreamSocket::SendQueue sendq 
pure virtual

Called when the hooked socket has data to write, or when the socket engine returns it as writable

sockHooked socket
sendqSend queue to send data from
1 if the sendq has been completely emptied, 0 if there is still data to send, and -1 if there was an error

Member Data Documentation

◆ prov

IOHookProvider* const IOHook::prov

The IOHookProvider for this hook, contains information about the hook, such as the module providing it and the hook type.

The documentation for this class was generated from the following file: