⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme

📁 spserver 是一个实现了半同步/半异步(Half-Sync/Half-Async)和领导者/追随者(Leader/Follower) 模式的服务器框架
💻
字号:
			 spserver README1.Introductionspserver is a TCP server framework library written in C++ based on libevent.spserver implements the Half-Sync/Half-Async and the Leader/Follower patterns.More detail about the Half-Sync/Half-Async and Leader/Follower patterns:	http://www.cs.wustl.edu/~schmidt/PDF/HS-HA.pdf	http://www.cs.wustl.edu/~schmidt/PDF/lf.pdfCode description:  SP_Server class implements the Half-Sync/Half-Async pattern.    SP_Server, SP_EventCallback, SP_Session, SP_Request(SP_MsgDecoder), SP_Response(SP_Message)      The asynchronous layer, which receives the asynchronous requests    SP_EventArg::mInputResultQueue, SP_EventArg::mOutputResultQueue      The queueing layer, which buffers the requests    SP_Executor, SP_ThreadPool, SP_Handler      The synchronous layer, which contains several threads of control blocked      on the queueing layer  SP_LFServer class implements the Leader/Follower pattern.The spserver code was developed under Linux, but has also been tested under Solaris.You can get the code from the spserver home page:	http://code.google.com/p/spserver/2.BuildingBefore building spserver, libevent must been installed. Test with libevent 1.1 and 1.2.You can donwload libevent from its home page:	http://www.monkey.org/~provos/libevent/Edit spserver/Makefile to specify the path of libevent:	LIBEVENT_INCL = -I<path_to_libevent_include>	LIBEVENT_LIB  = -L<path_to_libevent_library> -leventTo build libspserver.so, type$ cd spserver$ makeThis will build all the targets include examples. You can run theexample programs:$ ./testsmtp[msg] This server is listening on port [1025].Open another console, use telnet to test:$ telnet 127.0.0.1 1025	Trying 127.0.0.1...	Connected to 127.0.0.1.	Escape character is '^]'.	220 SMTP Server Ready	helo abc	250 ok.	mail from:<abc@abc.com>	250 sender ok.	rcpt to:<foo@bar.com>	250 recipient ok.	data	354 Start mail input; end with <CRLF>.<CRLF>	From: abc@abc.com	To: foo@bar.com 	Subject: test		test	.	250 Requested mail action okay, completed.	quit	221 Closing connection. Good bye.	Connection closed by foreign host.3.CreditsSpecial thanks go to Andrew Danforth, who provides a good solution touse libevent in multithreaded environment.Reports of successful use of spserver are appreciated.Enjoy!				-- stephen liu <stephen.nil@gmail.com>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -