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

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

Managermanager
 
std::deque< Packet * > packets
 

Additional Inherited Members

- Data Fields inherited from Socket
std::bitset< SF_SIZEflags
 
sockaddrs bindaddr
 
SocketIOio
 
- 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 ( Manager m,
const Anope::string ip,
int  port 
)
inline

Definition at line 560 of file m_dns.cpp.

UDPSocket::~UDPSocket ( )
inline

Definition at line 562 of file m_dns.cpp.

Member Function Documentation

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

Definition at line 574 of file m_dns.cpp.

Referenced by MyManager::GetID().

bool UDPSocket::ProcessRead ( )
inlinevirtual

Called when there is something to be received for this socket

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

bool UDPSocket::ProcessWrite ( )
inlinevirtual

Called when the socket is ready to be written to

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

void UDPSocket::Reply ( Packet p)
inlinevirtual

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* UDPSocket::manager
private

Definition at line 556 of file m_dns.cpp.

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

Definition at line 557 of file m_dns.cpp.


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