Anope IRC Services  Version 2.0
Public Member Functions | Data Fields
ClientSocket Class Reference

#include <sockets.h>

Inheritance diagram for ClientSocket:
Inheritance graph
Collaboration diagram for ClientSocket:
Collaboration graph

Public Member Functions

 ClientSocket (ListenSocket *ls, const sockaddrs &addr)
bool Process () anope_override
void ProcessError () anope_override
virtual void OnAccept ()
virtual void OnError (const Anope::string &error)
- Public Member Functions inherited from Socket
 Socket ()
 Socket (int sock, bool ipv6=false, int type=SOCK_STREAM)
virtual ~Socket ()
int GetFD () const
bool IsIPv6 () const
bool SetBlocking (bool state)
void Bind (const Anope::string &ip, int port=0)
virtual bool ProcessRead ()
virtual bool ProcessWrite ()

Data Fields

sockaddrs clientaddr
- Data Fields inherited from Socket
std::bitset< SF_SIZEflags
sockaddrs bindaddr

Additional Inherited Members

- Protected Attributes inherited from Socket
int sock
bool ipv6

Detailed Description

Definition at line 420 of file sockets.h.

Constructor & Destructor Documentation

◆ ClientSocket()

ClientSocket::ClientSocket ( ListenSocket ls,
const sockaddrs addr 


lsListen socket this connection is from
addrAddress the connection came from

Definition at line 61 of file socket_clients.cpp.

Member Function Documentation

◆ OnAccept()

void ClientSocket::OnAccept ( )

Called when a client has been accepted() successfully.

Reimplemented in ProxyCallbackListener::ProxyCallbackClient.

Definition at line 92 of file socket_clients.cpp.

Referenced by SocketIO::Accept(), SSLSocketIO::FinishAccept(), and SSLModule::OnPreServerConnect().

◆ OnError()

void ClientSocket::OnError ( const Anope::string error)

Called when there was an error accepting the client

Definition at line 96 of file socket_clients.cpp.

References LOG_DEBUG.

Referenced by SSLSocketIO::FinishAccept(), SSLModule::OnPreServerConnect(), and ProcessError().

◆ Process()

bool ClientSocket::Process ( )

Called when there either is a read or write event. Used to determine whether or not this socket is connected yet.

true to continue to call ProcessRead/ProcessWrite, false to not continue

Reimplemented from Socket.

Definition at line 65 of file socket_clients.cpp.

References SocketIO::FinishAccept(), Socket::flags, CoreException::GetReason(), Socket::io, SF_ACCEPTED, SF_ACCEPTING, and SF_DEAD.

◆ ProcessError()

void ClientSocket::ProcessError ( )

Called when there is an error for this socket

true on success, false to drop this socket

Reimplemented from Socket.

Definition at line 83 of file socket_clients.cpp.

References Socket::GetFD(), Anope::LastError(), and OnError().

Field Documentation

◆ clientaddr

sockaddrs ClientSocket::clientaddr

Definition at line 426 of file sockets.h.

Referenced by MyHTTPClient::Read().

◆ ls

ListenSocket* ClientSocket::ls

Definition at line 424 of file sockets.h.

Referenced by ModuleProxyScan::~ModuleProxyScan().

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