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

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

?? socket.h

?? common c++提供socket
?? H
?? 第 1 頁 / 共 4 頁
字號(hào):
 * @author David Sugar <dyfet@ostel.com> * @short streamable TCP socket connection. */class __EXPORT TCPStream : protected std::streambuf, public Socket, public std::iostream{private:	int doallocate();	void segmentBuffering(unsigned mss);	friend TCPStream& crlf(TCPStream&);	friend TCPStream& lfcr(TCPStream&);protected:	timeout_t timeout;	size_t bufsize;	Family family;	char *gbuf, *pbuf;public:	/**	 * The constructor required for building other classes or to	 * start an unconnected TCPStream for connect.	 */	TCPStream(Family family = IPV4, bool throwflag = true, timeout_t to = 0);	/**	 * Disconnect the current session and prepare for a new one.	 */	void disconnect(void);	/**	 * Get protocol segment size.	 */	int getSegmentSize(void);protected:	/**	 * Used to allocate the buffer space needed for iostream	 * operations.  This function is called by the constructor.	 *	 * @param size of stream buffers from constructor.	 */	void allocate(size_t size);	/**	 * Used to terminate the buffer space and cleanup the socket	 * connection.  This fucntion is called by the destructor.	 */	void endStream(void);	/**	 * This streambuf method is used to load the input buffer	 * through the established tcp socket connection.	 *	 * @return char from get buffer, EOF if not connected.	 */	int underflow();	/**	 * This streambuf method is used for doing unbuffered reads	 * through the establish tcp socket connection when in interactive mode.	 * Also this method will handle proper use of buffers if not in	 * interative mode.	 *	 * @return char from tcp socket connection, EOF if not connected.	 */	int uflow();	/**	 * This streambuf method is used to write the output	 * buffer through the established tcp connection.	 *	 * @param ch char to push through.	 * @return char pushed through.	 */	int overflow(int ch);	/**	 * Create a TCP stream by connecting to a TCP socket (on	 * a remote machine).	 *	 * @param host address of remote TCP server.	 * @param port number to connect.	 * @param mss maximum segment size of streaming buffers.	 */	void connect(const IPV4Host &host, tpport_t port, unsigned mss = 536);#ifdef	CCXX_IPV6	void connect(const IPV6Host &host, tpport_t port, unsigned mss = 536);#endif	/**	 * Connect a TCP stream to a named destination host and port	 * number, using getaddrinfo interface if available.	 *	 * @param name of host and service to connect	 * @param mss maximum segment size of stream buffer	 */	void connect(const char *name, unsigned mss = 536);	/**	 * Used in derived classes to refer to the current object via	 * it's iostream.  For example, to send a set of characters	 * in a derived method, one might use *tcp() << "test".	 *	 * @return stream pointer of this object.	 */	std::iostream *tcp(void)		{return ((std::iostream *)this);};public:	/**	 * Create a TCP stream by accepting a connection from a bound	 * TCP socket acting as a server.  This performs an "accept"	 * call.	 *	 * @param server socket listening	 * @param throwflag flag to throw errors.	 * @param timeout for all operations.	 */	TCPStream(TCPSocket &server, bool throwflag = true, timeout_t timeout = 0);#ifdef	CCXX_IPV6	TCPStream(TCPV6Socket &server, bool throwflag = true, timeout_t timeout = 0);#endif	/**	 * Accept a connection from a TCP Server.	 *	 * @param server socket listening	 */	void connect(TCPSocket &server);#ifdef	CCXX_IPV6	void connect(TCPV6Socket &server);#endif	/**	 * Create a TCP stream by connecting to a TCP socket (on	 * a remote machine).	 *	 * @param host address of remote TCP server.	 * @param port number to connect.	 * @param mss maximum segment size of streaming buffers.	 * @param throwflag flag to throw errors.	 * @param timeout for all operations.	 */	TCPStream(const IPV4Host &host, tpport_t port, unsigned mss = 536, bool throwflag = true, timeout_t timeout = 0);#ifdef	CCXX_IPV6	TCPStream(const IPV6Host &host, tpport_t port, unsigned mss = 536, bool throwflag = true, timeout_t timeout = 0);#endif	/**	 * Construct a named TCP Socket connected to a remote machine.	 *	 * @param name of remote service.	 * @param family of protocol.	 * @param mss maximum segment size of streaming buffers.	 * @param throwflag flag to throw errors.	 * @param timer for timeout for all operations.	 */	TCPStream(const char *name, Family family = IPV4, unsigned mss = 536, bool throwflag = false, timeout_t timer = 0);	/**	 * Set the I/O operation timeout for socket I/O operations.	 *	 * @param timer to change timeout.	 */	inline void setTimeout(timeout_t timer)		{timeout = timer;};	/**	 * A copy constructor creates a new stream buffer.	 *	 * @param source reference of stream to copy from.	 *	 */	TCPStream(const TCPStream &source);	/**	 * Flush and empty all buffers, and then remove the allocated	 * buffers.	 */	virtual ~TCPStream();	/**	 * Flushes the stream input and output buffers, writes	 * pending output.	 *	 * @return 0 on success.	 */	int sync(void);#ifdef	HAVE_SNPRINTF	/**	 * Print content into a socket.	 *	 * @return count of bytes sent.	 * @param format string	 */	size_t printf(const char *format, ...);#endif	/**	 * Get the status of pending stream data.  This can be used to	 * examine if input or output is waiting, or if an error or	 * disconnect has occured on the stream.  If a read buffer	 * contains data then input is ready and if write buffer	 * contains data it is first flushed and then checked.	 */	bool isPending(Pending pend, timeout_t timeout = TIMEOUT_INF);        /**          * Examine contents of next waiting packet.          *          * @param buf pointer to packet buffer for contents.          * @param len of packet buffer.          * @return number of bytes examined.          */         inline ssize_t peek(void *buf, size_t len)                 {return _IORET64 ::recv(so, (char *)buf, _IOLEN64 len, MSG_PEEK);};	/**	 * Return the size of the current stream buffering used.	 *	 * @return size of stream buffers.	 */	inline size_t getBufferSize(void) const		{return bufsize;};};/** * The TCP session is used to primarily to represent a client connection * that can be managed on a seperate thread.  The TCP session also supports * a non-blocking connection scheme which prevents blocking during the * constructor and moving the process of completing a connection into the  * thread that executes for the session. *  * @author David Sugar <dyfet@ostel.com> * @short Threaded streamable socket with non-blocking constructor. */class __EXPORT TCPSession : public Thread, public TCPStream{private:	TCPSession(const TCPSession &rhs); // not definedprotected:	/**	 * Normally called during the thread Initial() method by default,	 * this will wait for the socket connection to complete when	 * connecting to a remote socket.  One might wish to use	 * setCompletion() to change the socket back to blocking I/O	 * calls after the connection completes.  To implement the	 * session one must create a derived class which implements	 * run().	 * 	 * @return 0 if successful, -1 if timed out.	 * @param timeout to wait for completion in milliseconds.	 */	int waitConnection(timeout_t timeout = TIMEOUT_INF);	/**	 * The initial method is used to esablish a connection when	 * delayed completion is used.  This assures the constructor	 * terminates without having to wait for a connection request	 * to complete.	 */	void initial(void);public:	/**	 * Create a TCP socket that will be connected to a remote TCP	 * server and that will execute under it's own thread.	 * 	 * @param host internet address of remote TCP server.	 * @param port number of remote server.	 * @param size of streaming buffer.	 * @param pri execution priority relative to parent.	 * @param stack allocation needed on some platforms.	 */	TCPSession(const IPV4Host &host, 		tpport_t port, size_t size = 536, int pri = 0, size_t stack = 0);#ifdef	CCXX_IPV6	TCPSession(const IPV6Host &host,		tpport_t port, size_t size = 536, int pri = 0, size_t stack = 0);#endif	/**	 * Create a TCP socket from a bound TCP server by accepting a pending	 * connection from that server and execute a thread for the accepted	 * connection.	 * 	 * @param server tcp socket to accept a connection from.	 * @param pri execution priority relative to parent.	 * @param stack allocation needed on some platforms.	 */	TCPSession(TCPSocket &server, int pri = 0, size_t stack = 0);#ifdef	CCXX_IPV6	TCPSession(TCPV6Socket &server, int pri = 0, size_t stack = 0);#endif	/**	 * Make sure destruction happens through a virtual...	 */	virtual ~TCPSession();};#if defined(WIN32)/** *  class init_WSA used to initalise windows sockets specfifc stuff : there is *  an MS - specific init sequence for Winsock 2 this class attempts to  *  initalise Winsock 2.2 - needed for non - blocking I/O. It will fall back  *  on 1.2 or lower if 2.0 or higher is not available,  but < 2.0 does not  *  support non - blocking I/o *  TO DO : might be an idea to have a method that reports version of  *  Winsock in use or a predicate to test if non - blocking is OK -- JFC */class init_WSA{public:	init_WSA();	~init_WSA();};#endif // WIN32class __EXPORT SimpleTCPStream;/** * @class SimpleTCPStream * @brief Simple TCP Stream, to be used with Common C++ Library * * This source is derived from a proposal made by Ville Vainio * (vvainio@tp.spt.fi). * * @author Mark S. Millard (msm@wizzer.com) * @date   2002-08-15 * Copyright (C) 2002 Wizzer Works. **/class __EXPORT SimpleTCPStream : public Socket{private:	IPV4Host getSender(tpport_t *port) const;protected:	/**	 * The constructor required for "SimpleTCPStream", a more C++ style	 * version of the SimpleTCPStream class.	 */	SimpleTCPStream();	/**	 * Used to terminate the buffer space and cleanup the socket	 * connection.  This fucntion is called by the destructor.	 */	void endStream(void);	/**	 * Create a TCP stream by connecting to a TCP socket (on	 * a remote machine).	 *	 * @param host address of remote TCP server.	 * @param port number to connect.	 * @param size of streaming input and output buffers.	 */	void Connect(const IPV4Host &host, tpport_t port, size_t size);public:	/**	 * Create a TCP stream by accepting a connection from a bound	 * TCP socket acting as a server.  This performs an "accept"	 * call.	 *	 * @param server bound server tcp socket.	 * @param size of streaming input and output buffers.	 */	SimpleTCPStream(TCPSocket &server, size_t size = 512);	/**	 * Create a TCP stream by connecting to a TCP socket (on	 * a remote machine).	 *	 * @param host address of remote TCP server.	 * @param port number to connect.	 * @param size of streaming input and output buffers.	 */	SimpleTCPStream(const IPV4Host &host, tpport_t port, size_t size = 512);	/**	 * A copy constructor creates a new stream buffer.	 *	 * @param source A reference to the SimpleTCPStream to copy.	 */	SimpleTCPStream(const SimpleTCPStream &source);	/**	 * Flush and empty all buffers, and then remove the allocated	 * buffers.	 */	virtual ~SimpleTCPStream();	/**	 * @brief Get the status of pending stream data. 	 * 	 * This method can be used to examine if input or output is waiting,	 * or if an error or disconnect has occured on the stream.	 * If a read buffer contains data then input is ready. If write buffer	 * contains data, it is first flushed and then checked.	 *	 * @param pend Flag indicating means to pend.	 * @param timeout The length of time to wait.	 */	bool isPending(Pending pend, timeout_t timeout = TIMEOUT_INF);	void flush() {}	/**	 * @brief Read bytes into a buffer.	 *	 * <long-description>	 *	 * @param bytes A pointer to buffer that will contain the bytes read.	 * @param length The number of bytes to read (exactly).	 * @param timeout Period to time out, in milleseconds.	 *	 * @return The number of bytes actually read, 0 on EOF.	 */	ssize_t read(char *bytes, size_t length, timeout_t timeout = 0);	/**	 * @brief Write bytes to buffer	 *	 * <long-description>	 *	 * @param bytes A pointer to a buffer containing the bytes to write. 	 * @param length The number of bytes to write (exactly).	 * @param timeout Period to time out, in milleseconds.	 *	 * @return The number of bytes actually written.	 */	ssize_t write(const char *bytes, size_t length, timeout_t timeout = 0);	/**	 * @brief Peek at the incoming data.	 *	 * The data is copied into the buffer	 * but is not removed from the input queue. The function then returns	 * the number of bytes currently pending to receive.	 *	 * @param bytes A pointer to buffer that will contain the bytes read.	 * @param length The number of bytes to read (exactly).	 * @param timeout Period to time out, in milleseconds.	 *	 * @return The number of bytes pending on the input queue, 0 on EOF.	 */	ssize_t peek(char *bytes, size_t length, timeout_t timeout = 0);};#ifdef	COMMON_STD_EXCEPTIONclass __EXPORT SockException : public IOException{private:	Socket::Error _socketError;	public:	SockException(const String &str, Socket::Error socketError, long systemError = 0) :		IOException(str, systemError), _socketError(socketError) {};	inline Socket::Error getSocketError() const	{ return _socketError; }};#endif#ifdef	CCXX_NAMESPACES}#endif#endif/** EMACS ** * Local variables: * mode: c++ * c-basic-offset: 8 * End: */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区不卡在线播放| 成人91在线观看| 青青草原综合久久大伊人精品优势| 亚洲色图欧洲色图| 有码一区二区三区| 亚洲午夜激情av| 天天av天天翘天天综合网| 日本欧美一区二区三区| 精品午夜一区二区三区在线观看 | 国产精品麻豆99久久久久久| 欧美国产精品久久| 亚洲欧美一区二区三区孕妇| 亚洲乱码精品一二三四区日韩在线| 亚洲人成亚洲人成在线观看图片| 樱花影视一区二区| 日韩电影网1区2区| 国产精品一区在线| 91久久精品一区二区三区| 懂色av中文一区二区三区| 99久久精品免费| 欧美日韩一级二级三级| 欧美r级在线观看| 国产精品视频一二| 舔着乳尖日韩一区| 韩国成人福利片在线播放| 成人精品视频一区二区三区尤物| 91在线精品秘密一区二区| 欧美欧美欧美欧美首页| 欧美大胆一级视频| 中文字幕制服丝袜一区二区三区 | 中文成人av在线| 亚洲国产精品久久久久秋霞影院| 亚洲va欧美va人人爽| 国精品**一区二区三区在线蜜桃| 99国产精品久| 欧美va日韩va| 一区二区三区欧美亚洲| 蜜臀av一级做a爰片久久| 99在线精品观看| 欧美一区二区三区四区久久| 国产精品伦一区二区三级视频| 尤物在线观看一区| 韩国欧美国产1区| 在线看一区二区| 久久久久久久久一| 亚洲成a人片在线不卡一二三区| 国产精品69毛片高清亚洲| 欧美日韩亚洲综合一区| 欧美激情一区二区在线| 亚欧色一区w666天堂| 春色校园综合激情亚洲| 91精品久久久久久久99蜜桃| 日韩美女啊v在线免费观看| 日韩电影一区二区三区| 在线观看日韩电影| 国产蜜臀97一区二区三区| 日本在线观看不卡视频| 色哟哟精品一区| 久久精品人人做人人爽人人 | 欧美午夜电影在线播放| 国产精品丝袜一区| 日韩黄色免费网站| 91麻豆6部合集magnet| 精品成人免费观看| 日韩精品亚洲一区| 精品国产亚洲在线| 亚洲国产综合视频在线观看| 91久久精品一区二区二区| 久久久国产精品不卡| 日本vs亚洲vs韩国一区三区二区 | 日韩欧美一二三区| 性欧美疯狂xxxxbbbb| 97精品国产露脸对白| 2024国产精品| 久久国产人妖系列| 欧美精品少妇一区二区三区| 亚洲精品va在线观看| 国产福利一区二区三区| 精品国产一二三区| 久久精品久久精品| 日韩一区二区三区电影在线观看| 一区二区在线观看免费视频播放| 国产成人午夜视频| 久久伊人蜜桃av一区二区| 亚洲香肠在线观看| 欧美丝袜丝交足nylons图片| 亚洲人成网站精品片在线观看| 成人高清视频在线| 欧美高清在线一区| av日韩在线网站| 国产精品久久久久一区| 91色视频在线| 午夜精品福利一区二区三区蜜桃| 在线播放中文一区| 精品一区二区影视| 国产欧美日韩视频在线观看| 成人午夜在线免费| 亚洲精品日韩综合观看成人91| 欧美三级三级三级爽爽爽| 美国十次综合导航| 国产校园另类小说区| 色综合中文字幕| 视频一区中文字幕国产| 2020日本不卡一区二区视频| 高清在线不卡av| 一区二区高清视频在线观看| 欧美精品 国产精品| 激情图片小说一区| 亚洲欧洲日韩综合一区二区| 欧美日韩一区在线观看| 精品无人区卡一卡二卡三乱码免费卡| 国产精品视频免费看| 欧美亚洲高清一区| 国产在线精品视频| 亚洲欧美国产毛片在线| 7878成人国产在线观看| 国产成人av电影在线观看| 亚洲综合免费观看高清在线观看| 91精品视频网| av午夜一区麻豆| 免费在线观看成人| 亚洲欧美另类在线| 日韩欧美电影一区| 色综合天天综合| 美国三级日本三级久久99| 国产精品国产精品国产专区不蜜 | 午夜欧美视频在线观看| 国产欧美日韩久久| 91麻豆精品国产91久久久| 成人午夜电影网站| 日本成人中文字幕| 亚洲男人的天堂一区二区| 精品久久久久99| 在线观看国产91| 国产凹凸在线观看一区二区| 亚洲.国产.中文慕字在线| 中文字幕在线一区免费| 日韩精品资源二区在线| 日本高清不卡一区| 粗大黑人巨茎大战欧美成人| 日本欧美肥老太交大片| 亚洲视频免费在线观看| 久久人人97超碰com| 欧美日本不卡视频| 一本到一区二区三区| 国产一区二区三区在线观看免费视频 | 国产精品久久久久久久久快鸭| 精品视频1区2区| jlzzjlzz国产精品久久| 国产在线视视频有精品| 丝袜美腿一区二区三区| 亚洲黄色性网站| 国产精品久久久久久久蜜臀| 久久久蜜桃精品| 日韩欧美二区三区| 欧美精品99久久久**| 欧美无人高清视频在线观看| jizzjizzjizz欧美| 粉嫩av亚洲一区二区图片| 国产在线精品国自产拍免费| 免费在线观看一区| 日韩和欧美一区二区| 亚洲综合色在线| 伊人夜夜躁av伊人久久| 国产精品欧美一级免费| 国产欧美日韩另类一区| 久久久一区二区三区捆绑**| 日韩区在线观看| 日韩三级伦理片妻子的秘密按摩| 欧美精品一二三| 欧美日韩精品一区二区天天拍小说| 色婷婷综合久久久中文字幕| 91香蕉视频在线| 91麻豆蜜桃一区二区三区| 91色乱码一区二区三区| 99精品国产一区二区三区不卡| 波多野结衣在线aⅴ中文字幕不卡| 国产成人综合亚洲91猫咪| 国产电影一区在线| 国产 日韩 欧美大片| 高清久久久久久| 成人高清免费观看| 成人动漫一区二区三区| av午夜精品一区二区三区| 91亚洲精品久久久蜜桃| 97久久人人超碰| 色欧美日韩亚洲| 欧美午夜理伦三级在线观看| 欧美日韩一区二区三区视频| 欧美色国产精品| 欧美日韩大陆在线| 777亚洲妇女| 欧美zozozo| 久久免费的精品国产v∧| 久久蜜桃一区二区| 国产精品久久看| 亚洲夂夂婷婷色拍ww47| 手机精品视频在线观看| 激情欧美一区二区三区在线观看| 国产精品一区二区91|