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

Public Member Functions

 RedisSocket (MyRedisService *pro, bool v6)
 
 ~RedisSocket ()
 
void OnConnect () anope_override
 
void OnError (const Anope::string &error) anope_override
 
bool Read (const char *buffer, size_t l) anope_override
 
- Public Member Functions inherited from BinarySocket
 BinarySocket ()
 
virtual ~BinarySocket ()
 
bool ProcessRead () anope_override
 
bool ProcessWrite () anope_override
 
virtual void Write (const char *buffer, size_t l)
 
void Write (const char *message,...)
 
void Write (const Anope::string &message)
 
- 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)
 
- Public Member Functions inherited from ConnectionSocket
void Connect (const Anope::string &TargetHost, int Port)
 
bool Process () anope_override
 
void ProcessError () anope_override
 

Data Fields

MyRedisServiceprovider
 
std::deque< Interface * > interfaces
 
std::map< Anope::string,
Interface * > 
subinterfaces
 
- Data Fields inherited from Socket
std::bitset< SF_SIZEflags
 
sockaddrs bindaddr
 
SocketIOio
 
- Data Fields inherited from ConnectionSocket
sockaddrs conaddr
 

Private Member Functions

size_t ParseReply (Reply &r, const char *buf, size_t l)
 

Additional Inherited Members

- Protected Attributes inherited from BinarySocket
std::deque< DataBlock * > write_buffer
 
- Protected Attributes inherited from Socket
int sock
 
bool ipv6
 

Detailed Description

Definition at line 18 of file m_redis.cpp.

Constructor & Destructor Documentation

RedisSocket::RedisSocket ( MyRedisService pro,
bool  v6 
)
inline

Definition at line 26 of file m_redis.cpp.

RedisSocket::~RedisSocket ( )

Member Function Documentation

void RedisSocket::OnConnect ( )
virtual

Called on a successful connect

Reimplemented from ConnectionSocket.

Definition at line 276 of file m_redis.cpp.

References MyRedisService::db, Service::name, MyRedisService::SendCommand(), stringify(), and MyRedisService::sub.

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

Called when a connection is not successful

Parameters
errorThe error

Reimplemented from ConnectionSocket.

Definition at line 289 of file m_redis.cpp.

References Service::name, and MyRedisService::sub.

size_t RedisSocket::ParseReply ( Reply r,
const char *  buf,
size_t  l 
)
private
bool RedisSocket::Read ( const char *  buffer,
size_t  l 
)
virtual

Called with data from the socket

Parameters
bufferThe data
lThe length of buffer
Returns
true to continue reading, false to drop the socket

Reimplemented from BinarySocket.

Definition at line 429 of file m_redis.cpp.

References Redis::Reply::bulk, Redis::Reply::Clear(), LOG_DEBUG, Redis::Reply::MULTI_BULK, Redis::Reply::multi_bulk, Redis::Reply::multi_bulk_size, Redis::Reply::NOT_OK, Redis::Interface::OnError(), Redis::Interface::OnResult(), MyRedisService::sub, and Redis::Reply::type.

Field Documentation

std::deque<Interface *> RedisSocket::interfaces
MyRedisService* RedisSocket::provider

Definition at line 22 of file m_redis.cpp.

Referenced by MyRedisService::~MyRedisService().

std::map<Anope::string, Interface *> RedisSocket::subinterfaces

Definition at line 24 of file m_redis.cpp.

Referenced by MyRedisService::Subscribe(), and MyRedisService::Unsubscribe().


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