From cd9f9a8add02597a2998ba74b803ed3fbf81314c Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 27 Nov 2005 01:44:46 +0000 Subject: Added new documentation git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1966 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/socket_8h-source.html | 80 +++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 docs/module-doc/socket_8h-source.html (limited to 'docs/module-doc/socket_8h-source.html') diff --git a/docs/module-doc/socket_8h-source.html b/docs/module-doc/socket_8h-source.html new file mode 100644 index 000000000..402dc31cf --- /dev/null +++ b/docs/module-doc/socket_8h-source.html @@ -0,0 +1,80 @@ + +
+00001 /* +------------------------------------+ +00002 * | Inspire Internet Relay Chat Daemon | +00003 * +------------------------------------+ +00004 * +00005 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev. +00006 * E-mail: +00007 * <brain@chatspike.net> +00008 * <Craig@chatspike.net> +00009 * +00010 * Written by Craig Edwards, Craig McLure, and others. +00011 * This program is free but copyrighted software; see +00012 * the file COPYING for details. +00013 * +00014 * --------------------------------------------------- +00015 */ +00016 +00017 #ifndef __INSP_SOCKET_H__ +00018 #define __INSP_SOCKET_H__ +00019 +00020 #include <sys/types.h> +00021 #include <sys/socket.h> +00022 #include <netinet/in.h> +00023 #include <poll.h> +00024 #include <sstream> +00025 #include <string> +00026 +00027 enum InspSocketState { I_DISCONNECTED, I_CONNECTING, I_CONNECTED, I_LISTENING, I_ERROR }; +00028 enum InspSocketError { I_ERR_TIMEOUT, I_ERR_SOCKET, I_ERR_CONNECT, I_ERR_BIND }; +00029 +00030 class InspSocket +00031 { +00032 private: +00033 int fd; +00034 std::string host; +00035 int port; +00036 InspSocketState state; +00037 sockaddr_in addr; +00038 in_addr addy; +00039 time_t timeout_end; +00040 bool timeout; +00041 pollfd polls; +00042 char ibuf[1024]; +00043 sockaddr_in client; +00044 sockaddr_in server; +00045 socklen_t length; +00046 public: +00047 InspSocket(); +00048 InspSocket(int newfd); +00049 InspSocket(std::string host, int port, bool listening, unsigned long maxtime); +00050 virtual bool OnConnected(); +00051 virtual void OnError(InspSocketError e); +00052 virtual int OnDisconnect(); +00053 virtual bool OnDataReady(); +00054 virtual void OnTimeout(); +00055 virtual void OnClose(); +00056 virtual char* Read(); +00057 virtual int Write(std::string data); +00058 virtual int OnIncomingConnection(int newfd, char* ip); +00059 void SetState(InspSocketState s); +00060 InspSocketState GetState(); +00061 bool Poll(); +00062 virtual void Close(); +00063 virtual ~InspSocket(); +00064 }; +00065 +00066 #endif +
1.4.4-20050815
+
+
--
cgit v1.3.1-10-gc9f91