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

#include <sockets.h>

Inheritance diagram for ConnectionSocket:
Inheritance graph
[legend]
Collaboration diagram for ConnectionSocket:
Collaboration graph
[legend]

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
 
SocketIOio
 

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

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

Connect the socket

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

void ConnectionSocket::OnConnect ( )
virtual

Called on a successful connect

Reimplemented in SOCKS5ProxyConnect, HTTPProxyConnect, ProxyConnect, UplinkSocket, and RedisSocket.

Definition at line 52 of file socket_clients.cpp.

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

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

Called when a connection is not successful

Parameters
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(), and ProcessError().

bool ConnectionSocket::Process ( )
virtual

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

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

void ConnectionSocket::ProcessError ( )
virtual

Called when there is an error for this socket

Returns
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

sockaddrs ConnectionSocket::conaddr

Definition at line 391 of file sockets.h.

Referenced by ProxyConnect::Ban(), SSLSocketIO::Connect(), and SocketIO::Connect().


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