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

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

?? socketport.h

?? GNU Common C++ is a very portable and highly optimized class framework for writing C++ applications
?? H
字號:
// 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 socketport.h * @short Network service framework and design pattern. **/#ifndef	CCXX_SOCKETPORT_H_#define	CCXX_SOCKETPORT_H_#ifndef	CCXX_ADDRESS_H_#include <cc++/address.h>#endif#ifndef	CCXX_SOCKET_H_#include <cc++/socket.h>#endif#ifdef	CCXX_NAMESPACESnamespace ost {#endifclass __EXPORT SocketPort;class __EXPORT SocketService;/** * The socket port is an internal class which is attached to and then * serviced by a specific SocketService "object".  Derived versions of * this class offer specific functionality for specific protocols.  Both * Common C++ supporting frameworks and application objects may be derived * from related protocol specific base classes. *  * A special set of classes, "SocketPort" and "SocketService", exist * for building realtime streaming media servers on top of UDP and TCP * protocols.  The "SocketPort" is used to hold a connected or associated TCP * or UDP socket which is being "streamed" and which offers callback methods * that are invoked from a "SocketService" thread.  SocketService's can be * pooled into logical thread pools that can service a group of SocketPorts. * A millisecond accurate "timer" is associated with each SocketPort and can * be used to time synchronize SocketPort I/O operations. * * @author David Sugar <dyfet@ostel.com> * @short base class for realtime and thread pool serviced protocols. */class __EXPORT SocketPort : public Socket, public TimerPort{private:	SocketPort *next, *prev;	SocketService *service;#ifndef WIN32	struct timeval porttimer;#ifdef USE_POLL	struct pollfd	* ufd;#endif#else	HANDLE event;#endif	bool detect_pending;	bool detect_output;	bool detect_disconnect;		friend class SocketService;protected:	/** 	 * Construct an accepted TCP socket connection from a specific	 * bound TCP server.  This is meant to derive advanced application	 * specific TCP servers that can be thread pooled.	 *	 * @param svc pool thread object.	 * @param tcp socket object to accept.	 */	SocketPort(SocketService *svc, TCPSocket &tcp);#ifdef	CCXX_IPV6	SocketPort(SocketService *svc, TCPV6Socket &tcp);#endif	/**	 * Construct a bound UDP socket for use in deriving realtime	 * UDP streaming protocols handled by thread pool objects.	 *	 * @param svc pool thread object.	 * @param ia address of interface to bind.	 * @param port number to bind to.	 */	SocketPort(SocketService *svc, const IPV4Address &ia, tpport_t port);#ifdef	CCXX_IPV6	SocketPort(SocketService *svc, const IPV6Address &ia, tpport_t port);#endif		/**	 * A non-blocking constructor for outbound tcp connections.	 * To detect when the connection is established, overload	 * SocketPort::output().  SocketPort::output() get's called by	 * the SocketService when the connection is ready,	 * SocketPort::disconnect() when the connect failed.  at the	 * moment you should set the socket state to "CONNECTED" when	 * SocketPort::output() get's called for the first time.	 *	 * @param svc pool thread object.	 * @param ih addess to connect to.	 * @param port number to connect to.	 **/	SocketPort(SocketService *svc, const IPV4Host &ih, tpport_t port);#ifdef	CCXX_IPV6	SocketPort(SocketService *svc, const IPV6Host &ih, tpport_t port);#endif	/** 	 * Attach yourself to the service pool thread object. The later version.	 *	 * @param svc pool thread object 	 */	 	 void attach( SocketService* svc );	/**	 * Disconnect the socket from the service thread pool and	 * the remote connection.	 */		virtual ~SocketPort();	/**	 * Used to indicate if the service thread should monitor pending	 * data for us.	 */	void setDetectPending( bool );		/**	 * Get the current state of the DetectPending flag.	 */	bool getDetectPending( void ) const		{ return detect_pending; }		/**	 * Used to indicate if output ready monitoring should be performed	 * by the service thread.	 */	void setDetectOutput( bool );		/**	 * Get the current state of the DetectOutput flag.	 */	bool getDetectOutput( void ) const		{ return detect_output; }	/**	 * Called by the service thread pool when the objects timer	 * has expired.  Used for timed events.	 */	virtual void expired(void);	/**	 * Called by the service thread pool when input data is pending	 * for this socket.	 */	virtual void pending(void);	/**	 * Called by the service thread pool when output data is pending	 * for this socket.	 */	virtual void output(void);	/**	 * Called by the service thread pool when a disconnect has	 * occured.	 */	virtual void disconnect(void);	/**	 * Connect a Socket Port to a known peer host.  This is normally	 * used with the UDP constructor.  This is also performed as a	 * non-blocking operation under Posix systems to prevent delays	 * in a callback handler.	 *	 * @return 0 if successful.	 * @param ia address of remote host or subnet.	 * @param port number of remote peer(s).	 */	Error connect(const IPV4Address &ia, tpport_t port);#ifdef	CCXX_IPV6	Error connect(const IPV6Address &ia, tpport_t port);#endif	/**	 * Transmit "send" data to a connected peer host.  This is not	 * public by default since an overriding protocol is likely to	 * be used in a derived class.	 *	 * @return number of bytes sent.	 * @param buf address of buffer to send.	 * @param len of bytes to send.	 */	inline ssize_t send(const void *buf, size_t len)		{return _IORET64 ::send(so, (const char *)buf, _IOLEN64 len, 0);};	/**	 * Receive a message from any host.  This is used in derived	 * classes to build protocols.	 *	 * @param buf pointer to packet buffer to receive.	 * @param len of packet buffer to receive.	 * @return number of bytes received.	 */	inline ssize_t receive(void *buf, size_t len)		{return _IORET64 ::recv(so, (char *)buf, _IOLEN64 len, 0);};	/**	 * Examine the content of the next packet.  This can be used	 * to build "smart" line buffering for derived TCP classes.	 *	 * @param buf pointer to packet buffer to examine.	 * @param len of packet buffer to examine.	 * @return number of bytes actually available.	 */	inline ssize_t peek(void *buf, size_t len)		{return _IORET64 ::recv(so, (char *)buf, _IOLEN64 len, MSG_PEEK);};public:	/**	 * Derived setTimer to notify the service thread pool of change	 * in expected timeout.  This allows SocketService to 	 * reschedule all timers.  Otherwise same as TimerPort.	 *	 * @param timeout in milliseconds.	 */	void setTimer(timeout_t timeout = 0);	/**	 * Derived incTimer to notify the service thread pool of a	 * change in expected timeout.  This allows SocketService to	 * reschedule all timers.  Otherwise same as TimerPort.	 *	 * @param timeout in milliseconds.	 */	void incTimer(timeout_t timeout);};/** * The SocketService is a thread pool object that is meant to service * attached socket ports.  Multiple pool objects may be created and * multiple socket ports may be attached to the same thread of execution. * This allows one to balance threads and sockets they service rather than * either using a single thread for all connections or a seperate thread * for each connection.  Features can be added through supported virtual * methods. * * @author David Sugar <dyfet@ostel.com> * @short Thread pool service object for socket ports. */class __EXPORT SocketService : public Thread, private Mutex{private:#ifndef WIN32	fd_set connect;	int iosync[2];	int hiwater;#else	// private syncronization class	class Sync;	Sync* sync;#endif	int volatile count;	SocketPort* volatile first, *last;	/**	 * Attach a new socket port to this service thread.	 *	 * @param port of SocketPort derived object to attach.	 */	void attach(SocketPort *port);	/**	 * Detach a socket port from this service thread.	 *	 * @param port of SocketPort derived object to remove.	 */	void detach(SocketPort *port);		/**	 * The service thread itself.	 */	void run(void);	friend class SocketPort;protected:	/**	 * Handles all requests other than "termination".	 *	 * @param buf request id as posted from update().	 */	virtual void onUpdate(unsigned char buf);	/**	 * Called once each time the service thread is rescheduled.	 * This is called after the mutex is locked and can be used to	 * slip in additional processing.	 */	virtual void onEvent(void);	/**	 * Called for each port that is being processed in response to	 * an event.  This can be used to add additional notification	 * options during callback in combination with update().	 *	 * @param port SocketPort who's callback events are being evaluated.	 */	virtual void onCallback(SocketPort *port);public:	/**	 * Notify service thread that a port has been added or	 * removed, or a timer changed, so that a new schedule	 * can be computed for expiring attached ports.  A "0"	 * is used to terminate the service thread, and additional	 * values can be specified which will be "caught" in the	 * onUpdate() handler.	 *	 * @param flag update flag value.	 */	void update(unsigned char flag = 0xff);	/**	 * Create a service thread for attaching socket ports.  The	 * thread begins execution with the first attached socket.	 *	 * @param pri of this thread to run under.	 * @param stack stack size.	 * @param id thread ID.	 */	SocketService(int pri = 0, size_t stack = 0, const char *id = NULL);	/**	 * Terminate the thread pool and eliminate any attached	 * socket ports.	 */	virtual ~SocketService();	/**	 * Get current reference count.  This can be used when selecting	 * the least used service handler from a pool.	 *	 * @return count of active ports.	 */	inline int getCount(void) const		{return count;};};#ifdef	CCXX_NAMESPACES}#endif#endif/** EMACS ** * Local variables: * mode: c++ * c-basic-offset: 8 * End: */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃av一区二区在线观看| 成人av动漫网站| 国产一区二区不卡在线| 91国产视频在线观看| 欧美成va人片在线观看| 亚洲综合一区二区| 国产很黄免费观看久久| 91精品一区二区三区在线观看| 欧美激情艳妇裸体舞| 日韩av一区二区三区| 91亚洲国产成人精品一区二区三| 精品久久久久久最新网址| 一区二区三区在线观看动漫| 国产成都精品91一区二区三| 日韩色在线观看| 香蕉久久一区二区不卡无毒影院| 成人av先锋影音| 久久久久久久综合日本| 蜜桃av一区二区三区| 欧美美女直播网站| 亚洲免费在线电影| 91在线看国产| 国产精品久久久久aaaa樱花| 久久电影网电视剧免费观看| 在线综合亚洲欧美在线视频| 亚洲成人www| 欧美日韩日本视频| 亚洲国产裸拍裸体视频在线观看乱了 | 国产超碰在线一区| 日韩欧美一级二级三级久久久| 亚洲一区二区三区四区中文字幕| 欧美精品日韩一本| 亚洲黄网站在线观看| 99re视频精品| 综合色天天鬼久久鬼色| 99国产欧美久久久精品| **网站欧美大片在线观看| av网站一区二区三区| 中文字幕成人av| av不卡在线播放| 亚洲青青青在线视频| 91黄色激情网站| 五月天丁香久久| 4438x亚洲最大成人网| 婷婷六月综合网| 日韩欧美一区二区不卡| 精品夜夜嗨av一区二区三区| 久久你懂得1024| 成人av电影在线播放| 一区二区在线免费观看| 欧美军同video69gay| 蜜臀av一区二区在线免费观看 | 日韩一区二区不卡| 色偷偷成人一区二区三区91| 国产嫩草影院久久久久| 国产一区二区成人久久免费影院| 美国毛片一区二区三区| 欧美成人r级一区二区三区| 国产精品一区二区三区四区 | 亚洲一区二区偷拍精品| 这里只有精品99re| 国产激情精品久久久第一区二区| 亚洲视频狠狠干| 欧美福利视频导航| 国产精品66部| 一区二区三区在线看| 日韩欧美国产一二三区| 99久久久精品| 日韩va欧美va亚洲va久久| 国产日产欧美一区二区三区| 91福利区一区二区三区| 精品一区二区精品| 七七婷婷婷婷精品国产| 国产日韩欧美电影| 欧美日韩精品系列| 国产成人免费网站| 亚洲超碰97人人做人人爱| 久久精子c满五个校花| 在线一区二区三区做爰视频网站| 韩国欧美国产一区| 亚洲另类春色国产| 国产日韩影视精品| 7777精品伊人久久久大香线蕉 | 天天影视涩香欲综合网 | 中文字幕av一区二区三区免费看 | 免费人成网站在线观看欧美高清| 国产精品无遮挡| 欧美精品第1页| av亚洲精华国产精华精| 久久精品国产在热久久| 亚洲精品国产成人久久av盗摄| 精品久久久久香蕉网| 欧美日韩一区二区三区在线看 | 日韩一二三区视频| 色爱区综合激月婷婷| 成人一区二区视频| 精品写真视频在线观看| 日本伊人午夜精品| 亚洲一区中文日韩| 亚洲欧美日韩中文播放 | 制服丝袜在线91| 色狠狠av一区二区三区| 波多野结衣中文字幕一区二区三区 | 国产欧美一区二区精品性色 | 欧美aⅴ一区二区三区视频| 亚洲日本va在线观看| 中文字幕免费不卡| 国产色婷婷亚洲99精品小说| 日韩一区二区三区四区五区六区| 欧美日韩中文另类| 欧美色爱综合网| 欧美一a一片一级一片| 色琪琪一区二区三区亚洲区| 99久久99久久久精品齐齐| youjizz国产精品| 成人视屏免费看| 成人高清视频在线| 99久久婷婷国产| 色综合一个色综合亚洲| 97成人超碰视| 91国在线观看| 欧美人xxxx| 91精品国产免费| 欧美大片在线观看一区| 日韩欧美国产综合| 久久久另类综合| 日本一区二区三区国色天香| 国产日韩欧美精品一区| 亚洲欧洲日韩在线| 一区二区三区中文字幕电影 | 精品国产精品网麻豆系列| 2024国产精品| 国产精品久久看| 有坂深雪av一区二区精品| 亚洲国产精品一区二区www在线 | 国产永久精品大片wwwapp| 国产二区国产一区在线观看| 国产成人激情av| 色综合婷婷久久| 91精品久久久久久蜜臀| 久久久精品天堂| 亚洲女同一区二区| 日本在线不卡视频| 国产成人三级在线观看| 色综合久久久网| 日韩一区二区视频在线观看| 国产日韩欧美在线一区| 一区二区三区.www| 久草这里只有精品视频| av在线一区二区| 777久久久精品| 国产午夜久久久久| 一区二区三区国产精华| 精品一区二区免费视频| 91在线视频观看| 欧美成人一区二区三区在线观看 | 成人综合在线视频| 欧美丝袜丝交足nylons| 久久久五月婷婷| 亚洲一二三四区| 国产在线播放一区三区四| 色爱区综合激月婷婷| 亚洲精品在线三区| 亚洲一区二区成人在线观看| 97精品久久久午夜一区二区三区 | 欧美精品三级日韩久久| 国产三级三级三级精品8ⅰ区| 一区二区在线看| 成人性生交大片免费看在线播放| 欧美日韩免费观看一区三区| 国产精品久久看| 国产一区二区精品久久99| 欧美日韩在线三区| 成人免费在线播放视频| 激情丁香综合五月| 欧美一区二区网站| 亚洲午夜视频在线观看| 成人免费福利片| www国产亚洲精品久久麻豆| 亚洲图片自拍偷拍| 91日韩一区二区三区| 国产亚洲欧美激情| 久久国产精品第一页| 欧美精品亚洲一区二区在线播放| 亚洲少妇屁股交4| 国产精品一区二区x88av| 日韩欧美激情在线| 日韩国产欧美在线播放| 精品1区2区3区| 亚洲激情六月丁香| 91免费观看在线| 日韩理论在线观看| 94-欧美-setu| 国产精品蜜臀av| 成人福利视频网站| 国产欧美一区二区三区网站| 韩国精品主播一区二区在线观看| 欧美一区二区三区四区五区| 亚洲成国产人片在线观看| 欧美在线不卡视频|