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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线视频一区二区三| 久久综合色天天久久综合图片| 欧美日韩国产乱码电影| 久久久精品人体av艺术| 亚洲一区影音先锋| 国产在线不卡一卡二卡三卡四卡| 在线视频国内一区二区| 国产婷婷色一区二区三区四区 | 国产亚洲va综合人人澡精品 | 国产精品第五页| 久久精品99久久久| 欧美三级日本三级少妇99| 国产欧美日韩一区二区三区在线观看| 亚洲一区二区三区美女| 成人免费高清在线观看| www精品美女久久久tv| 午夜精品aaa| 欧美视频自拍偷拍| 亚洲欧美日韩在线播放| 成人精品视频.| 欧美激情综合在线| 国产二区国产一区在线观看| 欧美精品一区视频| 麻豆精品在线播放| 91精品国产手机| 日韩在线观看一区二区| 欧美久久婷婷综合色| 亚洲第一av色| 欧美日韩免费一区二区三区视频 | 久久91精品国产91久久小草| 欧美日本乱大交xxxxx| 午夜在线成人av| 777午夜精品免费视频| 五月天丁香久久| 91福利国产成人精品照片| 国产精品蜜臀av| 99久久夜色精品国产网站| 中文字幕一区二区三区不卡| 99免费精品视频| 日韩美女视频一区二区| 国产成人av福利| 中文字幕一区二区三区色视频| 成人免费va视频| 一区二区三区日韩欧美| 91美女在线观看| 国产精品传媒入口麻豆| 91猫先生在线| 亚洲国产成人av好男人在线观看| 欧美日韩一区成人| 久久精品国产精品亚洲红杏| 国产午夜一区二区三区| 99久久精品免费| 一区二区三区免费在线观看| 欧美日韩不卡一区二区| 麻豆精品一区二区三区| 国产精品大尺度| 在线看国产一区| 日韩国产精品久久| 国产亚洲福利社区一区| 一本大道av伊人久久综合| 亚洲国产精品欧美一二99| 色一情一伦一子一伦一区| 日韩av电影免费观看高清完整版在线观看| 在线播放日韩导航| 免费的成人av| 久久精品日产第一区二区三区高清版| www.亚洲在线| 亚洲成av人片| 国产亚洲欧美中文| 91视频观看视频| 久久99精品久久久久| 亚洲色图欧美偷拍| 精品欧美乱码久久久久久1区2区| 成人晚上爱看视频| 男人的天堂久久精品| 1区2区3区国产精品| 欧美v日韩v国产v| 欧美最新大片在线看 | a亚洲天堂av| 日本不卡视频一二三区| 中文字幕一区二区三区在线不卡| 欧美久久一二区| 色综合中文字幕| 美女视频黄a大片欧美| 亚洲激情校园春色| 国产欧美日韩在线观看| 欧美一区二区免费| 欧美午夜不卡在线观看免费| av一本久道久久综合久久鬼色| 亚洲国产欧美在线人成| 国产精品家庭影院| 久久精品一区二区| 精品久久久久久久久久久院品网 | 久久网这里都是精品| 在线欧美日韩精品| 成人国产精品免费观看动漫| 国产露脸91国语对白| 亚洲精品成人在线| 国产色产综合产在线视频| 日韩欧美一级二级| 欧美日韩的一区二区| 日本高清无吗v一区| 不卡在线观看av| 国产成人综合视频| 国产一区二区三区综合| 精品在线播放午夜| 午夜精品国产更新| 亚洲国产成人av好男人在线观看| 国产精品久久99| 国产精品久久午夜| |精品福利一区二区三区| 国产精品女主播av| 日本一区二区在线不卡| 久久久91精品国产一区二区三区| 精品剧情在线观看| 26uuu另类欧美| 久久精品一区二区三区不卡| 国产日韩欧美精品综合| 中文字幕在线不卡| 亚洲日本在线看| 亚洲一区二区精品视频| 亚洲成人tv网| 免费在线观看不卡| 国产九色sp调教91| 国产69精品久久久久毛片| 粉嫩aⅴ一区二区三区四区| 成人av资源下载| 91福利区一区二区三区| 欧美日韩综合一区| 欧美一级日韩免费不卡| 亚洲精品一区二区三区影院 | www.欧美日韩国产在线| 91香蕉视频污在线| 欧美日韩国产免费| www国产成人免费观看视频 深夜成人网 | 91精选在线观看| 精品区一区二区| 国产精品成人午夜| 肉色丝袜一区二区| 国产一区二区三区av电影| 99re热视频这里只精品| 欧美日本在线一区| 久久久99久久| 亚洲成人自拍网| 国产专区欧美精品| av电影天堂一区二区在线观看| 色又黄又爽网站www久久| 欧美人体做爰大胆视频| 国产日产欧美一区| 亚洲日本护士毛茸茸| 视频精品一区二区| 国产成a人亚洲精品| 欧美日韩中文精品| 久久久99久久| 舔着乳尖日韩一区| 国产91丝袜在线观看| 欧美日韩精品一区视频| 中文字幕成人av| 午夜亚洲福利老司机| 丁香五精品蜜臀久久久久99网站 | av一二三不卡影片| 制服丝袜激情欧洲亚洲| 国产精品久久福利| 久久91精品久久久久久秒播| 在线日韩国产精品| 国产片一区二区三区| 亚洲777理论| 色综合天天综合| 国产婷婷一区二区| 美日韩一区二区| 欧美这里有精品| 国产日产精品1区| 黄一区二区三区| 欧美精选在线播放| 亚洲资源中文字幕| 99免费精品视频| 国产女同性恋一区二区| 另类调教123区| 欧美丰满少妇xxxxx高潮对白| 国产精品国产三级国产aⅴ入口| 精品一区二区三区在线观看| 欧美猛男超大videosgay| 亚洲品质自拍视频| 丁香另类激情小说| 国产日本欧洲亚洲| 国产一区中文字幕| 精品国产1区二区| 另类欧美日韩国产在线| 日韩亚洲欧美在线观看| 午夜精品123| 欧美日韩成人综合天天影院 | 国产精品久线在线观看| 国产伦精一区二区三区| 欧美va亚洲va在线观看蝴蝶网| 午夜精品久久久久久久久久| 精品视频1区2区| 亚洲国产另类av| 欧美老肥妇做.爰bbww视频| 亚洲va韩国va欧美va精品| 欧美日韩国产电影|