anope

- supernets anope source code & configuration
git clone git://git.acid.vegas/anope.git
Log | Files | Refs | Archive | README

uplink.h (1028B)

      1 /*
      2  *
      3  * (C) 2003-2022 Anope Team
      4  * Contact us at team@anope.org
      5  *
      6  * Please read COPYING and README for further details.
      7  *
      8  * Based on the original code of Epona by Lara.
      9  * Based on the original code of Services by Andy Church.
     10  */
     11 
     12 #ifndef UPLINK_H
     13 #define UPLINK_H
     14 
     15 #include "sockets.h"
     16 #include "protocol.h"
     17 
     18 namespace Uplink
     19 {
     20 	extern void Connect();
     21 }
     22 
     23 /* This is the socket to our uplink */
     24 class UplinkSocket : public ConnectionSocket, public BufferedSocket
     25 {
     26  public:
     27 	bool error;
     28 	UplinkSocket();
     29 	~UplinkSocket();
     30 	bool ProcessRead() anope_override;
     31 	void OnConnect() anope_override;
     32 	void OnError(const Anope::string &) anope_override;
     33 
     34 	/* A message sent over the uplink socket */
     35 	class CoreExport Message
     36 	{
     37 		MessageSource source;
     38 		std::stringstream buffer;
     39 
     40 	 public:
     41 		Message();
     42 		Message(const MessageSource &);
     43 		~Message();
     44 		template<typename T> Message &operator<<(const T &val)
     45 		{
     46 			this->buffer << val;
     47 			return *this;
     48 		}
     49 	};
     50 };
     51 extern CoreExport UplinkSocket *UplinkSock;
     52 
     53 #endif // UPLINK_H