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

#include <sockets.h>

Inheritance diagram for ConnectionSocket:
Inheritance graph
Collaboration diagram for ConnectionSocket:
Collaboration graph

Public Member Functions

void Connect (const Anope::string &TargetHost, int Port)
bool Process () anope_override
void ProcessError () anope_override
virtual void OnConnect ()
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 conaddr
- 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 387 of file sockets.h.

Member Function Documentation

◆ Connect()

void ConnectionSocket::Connect ( const Anope::string TargetHost,
int  Port 

Connect the socket

TargetHostThe target host to connect to
PortThe target port to connect to

Definition at line 20 of file socket_clients.cpp.

References SocketIO::Connect(), and Socket::io.

Referenced by Uplink::Connect(), MyRedisService::MyRedisService(), ModuleProxyScan::OnUserConnect(), MyRedisService::Send(), and MyRedisService::Subscribe().

◆ OnConnect()

void ConnectionSocket::OnConnect ( )

◆ OnError()

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

Called when a connection is not successful

errorThe error

Reimplemented in UplinkSocket, and RedisSocket.

Definition at line 56 of file socket_clients.cpp.

References LOG_DEBUG.

Referenced by SSLSocketIO::Connect(), SocketIO::Connect(), SSLSocketIO::FinishConnect(), SocketIO::FinishConnect(), SSLModule::OnPreServerConnect(), and ProcessError().

◆ Process()

bool ConnectionSocket::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 25 of file socket_clients.cpp.

References SocketIO::FinishConnect(), Socket::flags, CoreException::GetReason(), Socket::io, SF_CONNECTED, SF_CONNECTING, and SF_DEAD.

◆ ProcessError()

void ConnectionSocket::ProcessError ( )

Called when there is an error for this socket

true on success, false to drop this socket

Reimplemented from Socket.

Definition at line 43 of file socket_clients.cpp.

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

Field Documentation

◆ conaddr

sockaddrs ConnectionSocket::conaddr

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