17 #include <netinet/in.h>
18 #include <sys/types.h>
19 #include <sys/socket.h>
24 #define NET_BUFSIZE 65535
77 void pton(
int type,
const Anope::string &address,
int pport = 0);
84 void ntop(
int type,
const void *src);
100 bool operator<(
const cidr &other)
const;
106 size_t operator()(
const cidr &s)
const;
147 virtual int Recv(
Socket *s,
char *buf,
size_t sz);
154 virtual int Send(
Socket *s,
const char *buf,
size_t sz);
220 Socket(
int sock,
bool ipv6 =
false,
int type = SOCK_STREAM);
240 bool SetBlocking(
bool state);
256 virtual bool ProcessRead();
261 virtual bool ProcessWrite();
266 virtual void ProcessError();
295 const
Anope::
string GetLine();
301 virtual
void Write(const
char *buffer,
size_t l);
303 void Write(const
char *message, ...);
304 void Write(const
Anope::
string &message);
309 int ReadBufferLen() const;
314 int WriteBufferLen() const;
345 bool ProcessWrite() anope_override;
351 virtual
void Write(const
char *buffer,
size_t l);
352 void Write(const
char *message, ...);
353 void Write(const
Anope::
string &message);
360 virtual
bool Read(const
char *buffer,
size_t l);
408 void ProcessError() anope_override;
412 virtual
void OnConnect();
417 virtual
void OnError(const
Anope::
string &error);
443 void ProcessError() anope_override;
447 virtual
void OnAccept();
451 virtual
void OnError(const
Anope::
string &error);
473 void Write(const
char *data,
size_t sz);
474 inline
void Write(const
Anope::
string &data) { this->
Write(data.c_str(), data.length() + 1); }
481 int Read(
char *data,
size_t sz);
487 bool SetWriteBlocking(
bool state);
496 virtual void OnNotify() = 0;
bool operator!=(const ci::string &leftval, const std::string &rightval)
std::bitset< SF_SIZE > flags
CoreExport SocketIO NormalSocketIO
virtual ~SocketException()
bool operator!=(const sockaddrs &other) const
virtual bool ProcessRead()
Anope::string write_buffer
std::deque< DataBlock * > write_buffer
bool operator==(const std::string &leftval, const ci::string &rightval)
CoreExport bool Send(User *from, NickCore *to, BotInfo *service, const Anope::string &subject, const Anope::string &message)
CoreExport uint32_t TotalWritten
SocketException(const Anope::string &message)
CoreExport uint32_t TotalRead
void Write(const Anope::string &data)
void Process(const Anope::string &)
Anope::string read_buffer