anope- supernets anope source code & configuration |
git clone git://git.acid.vegas/anope.git |
Log | Files | Refs | Archive | README |
socketengine.h (1024B)
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 SOCKETENGINE_H 13 #define SOCKETENGINE_H 14 15 #include "services.h" 16 #include "sockets.h" 17 18 class CoreExport SocketEngine 19 { 20 static const int DefaultSize = 2; // Uplink, mode stacker 21 public: 22 /* Map of sockets */ 23 static std::map<int, Socket *> Sockets; 24 25 /** Called to initialize the socket engine 26 */ 27 static void Init(); 28 29 /** Called to shutdown the socket engine 30 */ 31 static void Shutdown(); 32 33 /** Set a flag on a socket 34 * @param s The socket 35 * @param set Whether setting or unsetting 36 * @param flag The flag to set or unset 37 */ 38 static void Change(Socket *s, bool set, SocketFlag flag); 39 40 /** Read from sockets and do things 41 */ 42 static void Process(); 43 44 static int GetLastError(); 45 static void SetLastError(int); 46 47 static bool IgnoreErrno(); 48 }; 49 50 #endif // SOCKETENGINE_H