Public Member Functions | Protected Member Functions | Protected Attributes

BufferedSocket Class Reference

#include <sockets.h>

Inherits Socket.

Inherited by HTTPProxyConnect, ProxyCallbackListener::ProxyCallbackClient, and UplinkSocket.

Collaboration diagram for BufferedSocket:
Collaboration graph
[legend]

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

Detailed Description

Definition at line 264 of file sockets.h.


Constructor & Destructor Documentation

BufferedSocket::BufferedSocket (  ) 

Definition at line 17 of file socket_transport.cpp.

BufferedSocket::~BufferedSocket (  )  [virtual]

Definition at line 21 of file socket_transport.cpp.


Member Function Documentation

const Anope::string BufferedSocket::GetLine (  ) 
bool BufferedSocket::ProcessRead (  )  [virtual]

Called when there is something to be received for this socket

Returns:
true on success, false to drop 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

Returns:
true on success, false to drop this socket

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

Returns:
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

Parameters:
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

Returns:
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().


Field Documentation

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().


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