* | Inspire Internet Relay Chat Daemon |
* +------------------------------------+
*
- * InspIRCd: (C) 2002-2009 InspIRCd Development Team
+ * InspIRCd: (C) 2002-2010 InspIRCd Development Team
* See: http://wiki.inspircd.org/Credits
*
* This program is free but copyrighted software; see
class CoreExport StreamSocket : public EventHandler
{
/** Module that handles raw I/O for this socket, or NULL */
- Module *IOHook;
+ reference<Module> IOHook;
/** Private send queue. Note that individual strings may be shared
*/
std::deque<std::string> sendq;
protected:
std::string recvq;
public:
- StreamSocket() : IOHook(NULL), sendq_len(0) {}
- inline Module* GetIOHook() { return IOHook; }
- inline void AddIOHook(Module* m) { IOHook = m; }
- inline void DelIOHook() { IOHook = NULL; }
+ StreamSocket() : sendq_len(0) {}
+ inline Module* GetIOHook();
+ inline void AddIOHook(Module* m);
+ inline void DelIOHook();
/** Handle event from socket engine.
* This will call OnDataReady if there is *new* data in recvq
*/
*/
virtual void Close();
/** This ensures that close is called prior to destructor */
- virtual void cull();
+ virtual CullResult cull();
};
/**
* BufferedSocket is an extendable socket class which modules
BufferedSocketError BeginConnect(const std::string &ipaddr, int aport, unsigned long maxtime, const std::string &connectbindip);
};
+#include "modules.h"
+
+inline Module* StreamSocket::GetIOHook() { return IOHook; }
+inline void StreamSocket::AddIOHook(Module* m) { IOHook = m; }
+inline void StreamSocket::DelIOHook() { IOHook = NULL; }
#endif