Anope IRC Services  Version 2.0
Public Member Functions | Private Attributes
UDPSocket Class Reference
Inheritance diagram for UDPSocket:
Inheritance graph
Collaboration diagram for UDPSocket:
Collaboration graph

Public Member Functions

 UDPSocket (Manager *m, const Anope::string &ip, int port)
 ~UDPSocket ()
void Reply (Packet *p) anope_override
std::deque< Packet * > & GetPackets ()
bool ProcessRead () anope_override
bool ProcessWrite () anope_override
- Public Member Functions inherited from DNS::ReplySocket
virtual ~ReplySocket ()
- 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 Process ()
virtual void ProcessError ()

Private Attributes

std::deque< Packet * > packets

Additional Inherited Members

- Data Fields inherited from Socket
std::bitset< SF_SIZEflags
sockaddrs bindaddr
- Protected Attributes inherited from Socket
int sock
bool ipv6

Detailed Description

Definition at line 554 of file m_dns.cpp.

Constructor & Destructor Documentation

◆ UDPSocket()

UDPSocket::UDPSocket ( Manager m,
const Anope::string ip,
int  port 

Definition at line 560 of file m_dns.cpp.

◆ ~UDPSocket()

UDPSocket::~UDPSocket ( )

Definition at line 562 of file m_dns.cpp.

Member Function Documentation

◆ GetPackets()

std::deque<Packet *>& UDPSocket::GetPackets ( )

Definition at line 574 of file m_dns.cpp.

Referenced by MyManager::GetID().

◆ ProcessRead()

bool UDPSocket::ProcessRead ( )

Called when there is something to be received for this socket

true on success, false to drop this socket

Reimplemented from Socket.

Definition at line 576 of file m_dns.cpp.

References DNS::Manager::HandlePacket(), LOG_DEBUG_2, and sockaddrs::sa.

◆ ProcessWrite()

bool UDPSocket::ProcessWrite ( )

Called when the socket is ready to be written to

true on success, false to drop this socket

Reimplemented from Socket.

Definition at line 587 of file m_dns.cpp.

References Packet::addr, SocketEngine::Change(), LOG_DEBUG_2, Packet::Pack(), sockaddrs::sa, SF_WRITABLE, and sockaddrs::size().

◆ Reply()

void UDPSocket::Reply ( Packet p)

Implements DNS::ReplySocket.

Definition at line 568 of file m_dns.cpp.

References SocketEngine::Change(), and SF_WRITABLE.

Referenced by MyManager::Process().

Field Documentation

◆ manager

Manager* UDPSocket::manager

Definition at line 556 of file m_dns.cpp.

◆ packets

std::deque<Packet *> UDPSocket::packets

Definition at line 557 of file m_dns.cpp.

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