亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? socket.h

?? common c++提供socket
?? H
?? 第 1 頁 / 共 4 頁
字號:
// Copyright (C) 1999-2005 Open Source Telecom Corporation.//// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.//// You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.//// As a special exception, you may use this file as part of a free software// library without restriction.  Specifically, if other files instantiate// templates or use macros or inline functions from this file, or you compile// this file and link it with other files to produce an executable, this// file does not by itself cause the resulting executable to be covered by// the GNU General Public License.  This exception does not however    // invalidate any other reasons why the executable file might be covered by// the GNU General Public License.    //// This exception applies only to the code released under the name GNU// Common C++.  If you copy code from other releases into a copy of GNU// Common C++, as the General Public License permits, the exception does// not apply to the code that you add in this way.  To avoid misleading// anyone as to the status of such modified files, you must delete// this exception notice from them.//// If you write modifications of your own for GNU Common C++, it is your choice// whether to permit this exception to apply to your modifications.// If you do not wish that, delete this exception notice.///** * @file socket.h * @short Network addresses and sockets related classes. **/#ifndef	CCXX_SOCKET_H_#define	CCXX_SOCKET_H_#ifndef	CCXX_ADDRESS_H_#include <cc++/address.h>#endif#if defined(WIN32) && !defined(__CYGWIN32__)#include <io.h>#define	_IOLEN64	(unsigned)#define	_IORET64	(int)#define TIMEOUT_INF ~((timeout_t) 0)typedef int socklen_t;#else#define INVALID_SOCKET	-1typedef int SOCKET;#endif#ifndef	_IOLEN64#define	_IOLEN64#endif#ifndef	_IORET64#define	_IORET64#endif#ifndef	MSG_DONTWAIT#define	MSG_DONTWAIT	0#endif#ifndef	MSG_NOSIGNAL#define	MSG_NOSIGNAL	0#endif#ifdef	CCXX_NAMESPACESnamespace ost {#endif/** * Transport Protocol Ports. */typedef unsigned short tpport_t;/** * The Socket is used as the base for all Internet protocol services * under Common C++.  A socket is a system resource (or winsock descriptor) * that occupies a specific port address (and may be bound to a specific * network interface) on the local machine.  The socket may also be * directly connected to a specific socket on a remote internet host. *  * This base class is not directly used, but is * provided to offer properties common to other Common C++ socket classes, * including the socket exception model and the ability to set socket * properties such as QoS, "sockopts" properties like Dont-Route * and Keep-Alive, etc. *  * * @author David Sugar <dyfet@ostel.com> * @short base class of all sockets. */class __EXPORT Socket{public:	enum Family	{#ifdef	CCXX_IPV6		IPV6 = AF_INET6,#endif		IPV4 = AF_INET	};	typedef enum Family Family;	enum Error	{		errSuccess = 0,		errCreateFailed,		errCopyFailed,		errInput,		errInputInterrupt,		errResourceFailure,		errOutput,		errOutputInterrupt,		errNotConnected,		errConnectRefused,		errConnectRejected,		errConnectTimeout,		errConnectFailed,		errConnectInvalid,		errConnectBusy,		errConnectNoRoute,		errBindingFailed,		errBroadcastDenied,		errRoutingDenied,		errKeepaliveDenied,		errServiceDenied,		errServiceUnavailable,		errMulticastDisabled,		errTimeout,		errNoDelay,		errExtended,		errLookupFail,		errSearchErr,		errInvalidValue	};	typedef enum Error Error;	enum Tos	{		tosLowDelay = 0,		tosThroughput,		tosReliability,		tosMinCost,		tosInvalid	};	typedef enum Tos Tos;	enum Pending	{		pendingInput,		pendingOutput,		pendingError	};	typedef enum Pending Pending;protected:	enum State	{		INITIAL,		AVAILABLE,		BOUND,		CONNECTED,		CONNECTING,		STREAM	};	typedef enum State State;private:	// used by exception handlers....	mutable Error errid;	mutable const char *errstr;	mutable long syserr;	void setSocket(void);	friend SOCKET dupSocket(SOCKET s,Socket::State state);protected:	static Mutex mutex;	mutable struct	{		bool thrown: 1;		bool broadcast: 1;		bool route: 1;		bool keepalive: 1;		bool loopback: 1;		bool multicast: 1;		bool completion: 1;		bool linger: 1;		unsigned ttl: 8;	} flags;	/**	 * the actual socket descriptor, in Windows, unlike posix it 	 * *cannot* be used as an file descriptor	 * that way madness lies -- jfc	 */	SOCKET volatile so;	State volatile state;	/**	 * This service is used to throw all socket errors which usually	 * occur during the socket constructor.	 *	 * @param error defined socket error id.	 * @param err string or message to pass.	 * @param systemError the system error# that caused the error	 */	Error error(Error error, char *err = NULL, long systemError = 0) const;	/**	 * This service is used to throw application defined socket errors	 * where the application specific error code is a string.	 *	 * @param err string or message to pass.	 */	inline void error(char *err) const		{error(errExtended, err);};		/**	 * This service is used to turn the error handler on or off for	 * "throwing" exceptions by manipulating the thrown flag.	 *	 * @param enable true to enable handler.	 */	inline void setError(bool enable)		{flags.thrown = !enable;};	/**	 * Used as the default destructor for ending a socket.  This	 * will cleanly terminate the socket connection.  It is provided	 * for use in derived virtual destructors.	 */	void endSocket(void);	/**	 * Used as a common handler for connection failure processing.	 *	 * @return correct failure code to apply.	 */	Error connectError(void);	/**	 * Set the send limit.	 */	Error sendLimit(int limit = 2048);	/**	 * Set thr receive limit.	 */	Error receiveLimit(int limit = 1);	/**	 * Set the send timeout for sending raw network data.	 *	 * @return errSuccess if set.	 * @param timer value in millisec.	 */	Error sendTimeout(timeout_t timer);	/**	 * Receive timeout for receiving raw network data.	 *	 * @return errSuccess if set.	 * @param timer value in milliseconds.	 */	Error receiveTimeout(timeout_t timer);	/**	 * Set the protocol stack network kernel send buffer size 	 * associated with the socket.	 *	 * @return errSuccess on success, or error.	 * @param size of buffer in bytes.	 */	Error sendBuffer(unsigned size);        /**         * Set the protocol stack network kernel receive buffer size	 * associated with the socket.         *          * @return errSuccess on success, or error.          * @param size of buffer in bytes.         */        Error receiveBuffer(unsigned size);	/**	 * Set the total protocol stack network kernel buffer size 	 * for both send and receive together.	 *	 * @return errSuccess on success	 * @param size of buffer.	 */	Error bufferSize(unsigned size);	/**	 * Set the subnet broadcast flag for the socket.  This enables	 * sending to a subnet and may require special image privileges	 * depending on the operating system.	 *	 * @return 0 (errSuccess) on success, else error code.	 * @param enable when set to true.	 */	Error setBroadcast(bool enable);	/**	 * Setting multicast binds the multicast interface used for	 * the socket to the interface the socket itself has been	 * implicitly bound to.  It is also used as a check flag	 * to make sure multicast is enabled before multicast	 * operations are used.	 *	 * @return 0 (errSuccess) on success, else error code.	 * @param enable when set to true.	 * @param family of protocol.	 */	Error setMulticastByFamily(bool enable, Family family = IPV4);	/**	 * Set the multicast loopback flag for the socket.  Loopback	 * enables a socket to hear what it is sending.	 *	 * @return 0 (errSuccess) on success, else error code.	 * @param enable when set to true.	 * @param family of protocol.	 */	Error setLoopbackByFamily(bool enable, Family family = IPV4);	/**	 * Set the multicast time to live for a multicast socket.	 *	 * @return 0 (errSuccess) on success, else error code.	 * @param ttl time to live.	 * @param fam family of protocol.	 */	Error setTimeToLiveByFamily(unsigned char ttl, Family fam = IPV4);	/**	 * Join a multicast group.	 *	 * @return 0 (errSuccess) on success, else error code.	 * @param ia address of multicast group to join.	 */	Error join(const IPV4Multicast &ia);#ifdef	CCXX_IPV6	Error join(const IPV6Multicast &ia);#endif	/**	 * Drop membership from a multicast group.	 *	 * @return 0 (errSuccess) on success, else error code.	 * @param ia address of multicast group to drop.	 */	Error drop(const IPV4Multicast &ia);#ifdef	CCXX_IPV6	Error drop(const IPV6Multicast &ia);#endif	/**	 * Set the socket routing to indicate if outgoing messages	 * should bypass normal routing (set false).	 *	 * @return 0 on success.	 * @param enable normal routing when set to true.	 */	Error setRouting(bool enable);	/**	 * Enable/disable delaying packets (Nagle algorithm)	 *	 * @return 0 on success.	 * @param enable disable Nagle algorithm when set to true.	 */	Error setNoDelay(bool enable);	/**	 * An unconnected socket may be created directly on the local	 * machine.  Sockets can occupy both the internet domain (AF_INET)	 * and UNIX socket domain (AF_UNIX) under unix.  The socket type	 * (SOCK_STREAM, SOCK_DGRAM) and protocol may also be specified.	 * If the socket cannot be created, an exception is thrown.	 * 	 * @param domain socket domain to use.	 * @param type base type and protocol family of the socket.	 * @param protocol specific protocol to apply.	 */	Socket(int domain, int type, int protocol = 0);	/**	 * A socket object may be created from a file descriptor when that	 * descriptor was created either through a socket() or accept()	 * call.  This constructor is mostly for internal use.	 * 	 * @param fd file descriptor of an already existing socket.	 */	Socket(SOCKET fd);	/**	 * Create an inactive socket object for base constructors.	 */	Socket();	/**         * A socket can also be constructed from an already existing         * Socket object. On POSIX systems, the socket file descriptor         * is dup()'d. On Win32, DuplicateHandle() is used.	 * 	 * @param source of existing socket to clone.	 */	Socket(const Socket &source);	/**	 * Process a logical input line from a socket descriptor	 * directly.	 *	 * @param buf pointer to string.	 * @param len maximum length to read.	 * @param timeout for pending data in milliseconds.	 * @return number of bytes actually read.	 */	ssize_t readLine(char *buf, size_t len, timeout_t timeout = 0);        /**         * Read in a block of len bytes with specific separator.  Can         * be zero, or any other char.  If \\n or \\r, it's treated just         * like a readLine().  Otherwise it looks for the separator.         *         * @param buf pointer to byte allocation.         * @param len maximum length to read.         * @param separator separator for a particular ASCII character         * @param t timeout for pending data in milliseconds.         * @return number of bytes actually read.         */        virtual ssize_t readData(void * buf,size_t len,char separator=0,timeout_t t=0);        /**         * Write a block of len bytes to socket.         *         * @param buf pointer to byte allocation.         * @param len maximum length to write.         * @param t timeout for pending data in milliseconds.         * @return number of bytes actually read.         */        virtual ssize_t writeData(const void* buf,size_t len,timeout_t t=0);public:	/**	 * The socket base class may be "thrown" as a result of an	 * error, and the "catcher" may then choose to destroy the	 * object.  By assuring the socket base class is a virtual	 * destructor, we can assure the full object is properly	 * terminated.	 */	virtual ~Socket();	/**	 * See if a specific protocol family is available in the	 * current runtime environment.	 *	 * @return true if family available.	 */	static bool check(Family fam);	/**	 * Sockets may also be duplicated by the assignment operator.	 */	Socket &operator=(const Socket &from);	/**	 * May be used to examine the origin of data waiting in the	 * socket receive queue.  This can tell a TCP server where pending	 * "connect" requests are coming from, or a UDP socket where it's

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩专区欧美专区| 蜜桃av噜噜一区| 色噜噜夜夜夜综合网| 亚洲免费观看高清完整版在线| 99国产欧美另类久久久精品| 亚洲啪啪综合av一区二区三区| 色综合天天视频在线观看| 亚洲综合男人的天堂| 欧美少妇一区二区| 精品在线播放免费| 国产精品国产自产拍在线| 色偷偷成人一区二区三区91| 亚洲精品日韩专区silk| 欧美丰满美乳xxx高潮www| 激情六月婷婷久久| 中文字幕精品一区二区精品绿巨人| 91影院在线免费观看| 天天色天天爱天天射综合| 久久综合狠狠综合久久综合88 | 丝瓜av网站精品一区二区| 91精品国产综合久久精品麻豆| 麻豆91在线看| 自拍偷拍欧美激情| 日韩亚洲欧美在线| 99精品视频一区二区三区| 日日摸夜夜添夜夜添亚洲女人| 久久综合狠狠综合| 欧美性猛交xxxx黑人交| 国产精品一区在线观看你懂的| 亚洲精品久久嫩草网站秘色| 欧美大片顶级少妇| 在线精品视频免费观看| 国产在线国偷精品产拍免费yy| 亚洲欧美日韩人成在线播放| 欧美成人bangbros| 精品视频色一区| 成人av小说网| 国产一区二区三区在线观看免费视频 | 性做久久久久久久久| 久久久久久麻豆| 欧美男男青年gay1069videost| 国产在线播放一区二区三区| 亚洲国产成人porn| 成人欧美一区二区三区在线播放| 日韩欧美中文字幕一区| 欧美吞精做爰啪啪高潮| 99久久综合99久久综合网站| 精品一区二区成人精品| 亚洲va欧美va天堂v国产综合| 国产精品系列在线| 精品国产免费久久| 91精品午夜视频| 在线观看免费成人| 91视频xxxx| 成人福利视频在线看| 国产在线精品免费av| 日韩高清在线不卡| 亚洲午夜视频在线观看| 国产精品日产欧美久久久久| 久久久精品国产免费观看同学| 日韩一卡二卡三卡四卡| 欧美狂野另类xxxxoooo| 欧美日韩一区成人| 欧美日韩一区二区三区四区五区| eeuss鲁片一区二区三区在线观看| 国产一区二区91| 国产精品18久久久久久vr| 精品制服美女丁香| 捆绑调教美女网站视频一区| 免费成人在线播放| 久久国产婷婷国产香蕉| 精品一区在线看| 国产综合成人久久大片91| 黄网站免费久久| 国内不卡的二区三区中文字幕| 极品少妇一区二区| 国产寡妇亲子伦一区二区| 国产成人av福利| 不卡一区二区在线| 色综合久久中文综合久久牛| 色偷偷一区二区三区| 在线中文字幕一区二区| 欧美日韩一级二级| 欧美一级欧美三级在线观看| 欧美一区二区视频在线观看2022| 3atv一区二区三区| 欧美mv日韩mv亚洲| 国产拍欧美日韩视频二区| 日韩一区在线播放| 亚洲影视资源网| 老汉av免费一区二区三区 | 丁香六月久久综合狠狠色| 成人黄色一级视频| 91成人免费在线视频| 欧美日韩国产欧美日美国产精品| 欧美久久一二区| 2021中文字幕一区亚洲| 国产精品少妇自拍| 亚洲精品伦理在线| 日本 国产 欧美色综合| 韩国欧美国产一区| jizzjizzjizz欧美| 欧美日韩高清在线播放| 精品国产乱码久久久久久闺蜜 | 精品国产99国产精品| 欧美激情一区不卡| 亚洲主播在线播放| 久草中文综合在线| 一本色道久久综合精品竹菊| 欧美日本一区二区| 国产欧美一区二区精品忘忧草| 亚洲激情男女视频| 激情欧美日韩一区二区| 色哟哟一区二区| 精品理论电影在线| 亚洲婷婷在线视频| 老司机精品视频导航| 色欧美日韩亚洲| 精品国产不卡一区二区三区| 亚洲精品国产一区二区精华液 | 午夜精品国产更新| 粉嫩久久99精品久久久久久夜| 91黄色免费观看| 国产清纯白嫩初高生在线观看91 | 欧美性视频一区二区三区| 26uuu精品一区二区| 亚洲成人自拍网| 99久免费精品视频在线观看| 欧美mv日韩mv国产网站| 亚洲地区一二三色| 99国产精品国产精品毛片| 日韩欧美国产一区二区在线播放 | 国产精品久久久久影院亚瑟| 日韩激情中文字幕| 色哟哟国产精品免费观看| 国产婷婷色一区二区三区| 日韩国产在线一| 色噜噜狠狠成人网p站| 久久久久亚洲综合| 免费精品视频在线| 欧美日韩国产成人在线91| 亚洲女同ⅹxx女同tv| 成人久久18免费网站麻豆| 2023国产一二三区日本精品2022| 日韩黄色片在线观看| 欧美日韩美少妇| 亚洲夂夂婷婷色拍ww47| 成人天堂资源www在线| 久久日一线二线三线suv| 麻豆精品视频在线| 日韩欧美中文字幕制服| 天天操天天色综合| 欧美日韩免费不卡视频一区二区三区| 中文字幕一区三区| 成人综合在线观看| 欧美国产成人在线| 狠狠色丁香久久婷婷综| 日韩一区二区三区在线视频| 亚洲一区在线视频| 欧洲色大大久久| 亚洲国产一区二区在线播放| 色婷婷久久久久swag精品| 综合欧美亚洲日本| 日本乱人伦aⅴ精品| 一区二区成人在线视频| 欧美在线观看18| 五月婷婷色综合| 欧美一级片免费看| 久久精工是国产品牌吗| 日韩女优电影在线观看| 免费成人在线视频观看| 欧美成人福利视频| 国产精品一区二区久激情瑜伽 | 色狠狠色噜噜噜综合网| 亚洲一区精品在线| 欧美精选午夜久久久乱码6080| 午夜电影久久久| 日韩美一区二区三区| 国产乱码精品一区二区三区忘忧草 | 中文字幕一区在线观看| 91在线免费看| 午夜亚洲福利老司机| 欧美一区日韩一区| 久久99九九99精品| 国产亚洲成年网址在线观看| 成人av综合在线| 亚洲电影视频在线| 日韩欧美国产综合在线一区二区三区| 国内欧美视频一区二区 | 欧洲精品视频在线观看| 日韩在线a电影| 国产日韩欧美精品一区| 色综合天天综合网国产成人综合天| 亚洲一区在线视频| 欧美成人官网二区| 99久久综合精品| 免费成人在线影院| 中文字幕一区在线| 欧美一级午夜免费电影| a亚洲天堂av|