📄 readme
字号:
This file describes how to invoke the tests in the$ACE_ROOT/examples/Service_Configurator/IPC-test/{client,server}directories. These tests exercise all of the ACE IPC SAPcommunication mechanisms, the Reactor event demultiplexor, and theService Configurator dynamic service configuration framework. To gaina deeper understanding of what is going on, you should read the theWrapper Facade, Reactor, and Component Configurator patterns in POSA2<http://www.cs.wustl.edu/~schmidt/POSA/> and check out the followingpapers on the ACE framework components:http://www.cs.wustl.edu/~schmidt/PDF/IPC_SAP-92.pdfhttp://www.cs.wustl.edu/~schmidt/PDF/Reactor1-93.pdfhttp://www.cs.wustl.edu/~schmidt/PDF/Reactor2-93.pdfhttp://www.cs.wustl.edu/~schmidt/PDF/reactor-rules.pdfhttp://www.cs.wustl.edu/~schmidt/PDF/Svc-Conf.pdfThe key to running these client/server tests is to understand thepurpose of the svc.conf file located in the$ACE_ROOT/examples/Service_Configurator/IPC-test/server/ directory.This file contains a list of services that may be dynamicallyconfigured into a the address space of a network daemon process. Ifyou look at the example svc.conf file included in the tests you'll seethat some entries are commented out (the comment symbol is the '#',which is an "ignore until end-of-line comment" with the same semanticsas the UNIX C and Bourne shells). Before reading any further, take alook at this svc.conf file with your favorite editor or file browser.There are several types of entries in this file. The two mostimportant are the lines beginning with the keywords "static" and"dynamic". For example, the first non-commented line says:static ACE_Service_Manager "-d -p 3911"When this line is parsed at startup time by the Service Configuratorobject in the ./server_test executable, it causes the pre-configuredSvc_Manager object to be initialized with an "argv" argument of "-d -p3911." This results in TCP port 3911 being created to listenconnection requests from clients. To see how this works do thefollowing:1. Comment out all the other lines except static Svc_Manager "-d -p 3911" in the svc.conf file2. Start up the ./server_test executable in one window, as follows: % ./server_test -d3. Make another window on the *same* host and cd to the ./client/ directory 4. Run the ./remote_service_directory_test program as follows: % ./remote_service_directory_test -p 3911 -h localhostIf everything has been compiled and initialized correctly, you shouldget the following message: Svc_Manager 3911/tcp # lists all services in the daemonThis message is telling you that the Svc_Manager is currently the onlyservice that is active within the ./server_test program. To configureand activate another service dynamically, perform the following steps:1. *Without* shutting down the ./server_test program, edit the svc.conf file. Comment out the Svc_Manager line by adding a '#' at the front, i.e.: # static Svc_Manager "-d -p 3911" and then uncomment the second line: dynamic Remote_Brdcast Service_Object * ./IPC_Tests_Server:remote_broadcast "-p 10001"2. If you're running on an OS platform that supports SIGHUP, send the SIGHUP signal to the process running the ./server_test program. This will cause the ./server_test program to reconfigure itself based on the new contents of the svc.conf file. Not every platform supports SIGHUP. However, the remote_service_directory_test in ./client/ can be used to reconfigure services, e.g., by passing it parameters as follows: % ./remote_service_directory_test -p 3911 -h localhost -r The '-r' flag instructs the server to reconfigure itself. After reconfiguration, you'll now have a second active service in the address space of the ./server_test daemon. To see this, rerun the remote_service_directory_test command, e.g.: % ./remote_service_directory_test -p 3911 -h localhost You should now see the following output: Svc_Manager 3911/tcp # lists all services in the daemon Remote_Brdcast 10001/udp # tests broadcasting which indicates that the remote broadcast service is now active.3. To test the remote broadcast service, run the following program in the ./client/ directory: % ./broadcast_client_test -p 10001 This should cause the window running the ./server_test to display the following output: received broadcast datagram from host spare.ics.uci.edu ---------------------------------------- testing socket broadcast service ----------------------------------------If you want to run other tests, using other configurations, simplyuncomment the appropriate lines in the svc.conf file and experimentwith the corresponding test drivers in the ./client/ directory. Allthe source code is available so once you get the hang of what ishappening, you might want to take a look at how it is all implemented.You may be surprised at how much of the ACE framework code isreused for each different service. Moreover, writing a new service isoften simply a matter of copying an existing file and filling in thebehavior of some of the methods (e.g., the handle_input() method andthe init() method).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -