#include <sockets.h>
Inherits Socket.
Inherited by HTTPProxyConnect, ProxyCallbackListener::ProxyCallbackClient, and UplinkSocket.

Public Member Functions | |
| BufferedSocket () | |
| virtual | ~BufferedSocket () |
| bool | ProcessRead () anope_override |
| bool | ProcessWrite () anope_override |
| const Anope::string | GetLine () |
| void | Write (const char *message,...) |
| void | Write (const Anope::string &message) |
| int | ReadBufferLen () const |
| int | WriteBufferLen () const |
Protected Member Functions | |
| virtual void | Write (const char *buffer, size_t l) |
Protected Attributes | |
| Anope::string | read_buffer |
| Anope::string | write_buffer |
| int | recv_len |
Definition at line 264 of file sockets.h.
| BufferedSocket::BufferedSocket | ( | ) |
Definition at line 17 of file socket_transport.cpp.
| BufferedSocket::~BufferedSocket | ( | ) | [virtual] |
Definition at line 21 of file socket_transport.cpp.
| const Anope::string BufferedSocket::GetLine | ( | ) |
Gets the new line from the input buffer, if any
Definition at line 54 of file socket_transport.cpp.
References Anope::string::erase(), Anope::string::find(), Anope::string::ltrim(), Anope::string::npos, read_buffer, Anope::string::substr(), and Anope::string::trim().
Referenced by UplinkSocket::ProcessRead(), and HTTPProxyConnect::ProcessRead().
| bool BufferedSocket::ProcessRead | ( | ) | [virtual] |
Called when there is something to be received for this socket
Reimplemented from Socket.
Reimplemented in UplinkSocket, and HTTPProxyConnect.
Definition at line 25 of file socket_transport.cpp.
References Anope::string::append(), Socket::io, read_buffer, SocketIO::Recv(), and recv_len.
| bool BufferedSocket::ProcessWrite | ( | ) | [virtual] |
Called when the socket is ready to be written to
Reimplemented from Socket.
Reimplemented in ProxyCallbackListener::ProxyCallbackClient.
Definition at line 42 of file socket_transport.cpp.
References SocketEngine::Change(), Anope::string::empty(), Socket::io, SocketIO::Send(), SF_WRITABLE, Anope::string::substr(), and write_buffer.
Referenced by UplinkSocket::~UplinkSocket().
| int BufferedSocket::ReadBufferLen | ( | ) | const |
Get the length of the read buffer
Definition at line 91 of file socket_transport.cpp.
References recv_len.
Referenced by Message::Stats::Run().
| void BufferedSocket::Write | ( | const char * | message, | |
| ... | ||||
| ) |
Definition at line 71 of file socket_transport.cpp.
References Write().
| void BufferedSocket::Write | ( | const char * | buffer, | |
| size_t | l | |||
| ) | [protected, virtual] |
Write to the socket
| message | The message |
Definition at line 65 of file socket_transport.cpp.
References SocketEngine::Change(), SF_WRITABLE, and write_buffer.
Referenced by ProxyCallbackListener::ProxyCallbackClient::OnAccept(), HTTPProxyConnect::OnConnect(), Write(), and UplinkSocket::Message::~Message().
| void BufferedSocket::Write | ( | const Anope::string & | message | ) |
Definition at line 86 of file socket_transport.cpp.
References Anope::string::c_str(), Anope::string::length(), and Write().
| int BufferedSocket::WriteBufferLen | ( | ) | const |
Get the length of the write buffer
Definition at line 96 of file socket_transport.cpp.
References Anope::string::length(), and write_buffer.
Referenced by Message::Stats::Run().
Anope::string BufferedSocket::read_buffer [protected] |
Definition at line 268 of file sockets.h.
Referenced by GetLine(), and ProcessRead().
int BufferedSocket::recv_len [protected] |
Definition at line 272 of file sockets.h.
Referenced by ProcessRead(), and ReadBufferLen().
Anope::string BufferedSocket::write_buffer [protected] |
Definition at line 270 of file sockets.h.
Referenced by ProcessWrite(), ProxyCallbackListener::ProxyCallbackClient::ProcessWrite(), Write(), and WriteBufferLen().
1.7.1