난민들은 아래와 같은 평범한 단어들을 잃어버렸습니다. 집, 가족, 직업, 인권, 미래… - UNHCR(유엔난민고등 판무관실)
* 원문링크 :
http://www.cs.wustl.edu/~schmidt/ACE-netsvcs.html
file://C:/ACE_wrappers/ACE-INSTALL.html#svcsinstall
http://www.cs.wustl.edu/~schmidt/ACE-netsvcs.html
file://C:/ACE_wrappers/ACE-INSTALL.html#svcsinstall
- 언제나 그렇지만 제 주관에 따라 원문의 구성이 좀 달라질 수 있습니다.
1 ACE 네트워크 서비스 개요 #
ACE는 아래와 같은 네트워크 서비스에 대한 표준 라이브러리를 제공하고 있습니다:
- Naming 서비스
- Time 서비스
- Token 서비스
- Server 로깅 서비스
- Client 로깅 서비스
- Logging Strategy 서비스
- 이들은 로깅, 네이밍(naming), 원격 잠금, 시간 동기화와 같은 일반적인 분산 시스템 작업을 위한 재사용가능한 컴퍼넌트를 제공합니다.
- 이들 서비스의 소스코드는 IPC wrappers, Reactor, Service Configurator, Service Initialization, Concurrency 컴퍼넌트와 같은 ACE 기능을 다루를 법에 대한 예제를 제공합니다.
2.1 UNIX상에서의 빌드 및 설치 #
비교적 간단합니다. Building and installing ACE Network Services on UNIX is relatively simple (the process for Win32 is different). Here's what you need to do:
Build and install ACE on UNIX as described earlier. If ACE is built at the root of the ACE source tree (and ACE has been ported to your platform, of course) the netsvcs static and shared object libraries should be built automatically. In addition, the server driver program (main) contained in $ACE_ROOT/netsvcs/servers/main.cpp should also be compiled and ready to run.
Set your LD_LIBRARY_PATH environment variable to where the binary version of the ACE netsvcs library. For example, you probably want to do something like the following
% setenv LD_LIBRARY_PATH $ACE_ROOT/ace:$LD_LIBRARY_PATH
By default, if the shared object library is built, the services are linked into the main driver program dynamically. To specify which services should be linked in and executed, edit the $ACE_ROOT/netsvcs/servers/svc.conf file. During your editing, you should update information (such as the default service port numbers) that affects the initialization of services in this file. Refer to the Service Configurator documentation to learn how the configuration file is parsed and how the services are dynamically linked and executed. In addition, refer to the Network Services documentation to learn more about how to configure each network service.
If you only want to link the services statically, simply remove or rename the svc.conf file.
3 Overview of Server Logging Service #
The Server Logging Service provides a concurrent, multi-service daemon that processes logging records received from one or more client hosts simultaneously. The object-oriented design of the Server Logging Service is decomposed into several modular components that perform well-defined tasks.
The following are the key classes in the Server Logging Service:
- Server_Logging_Handler : The Server_Logging_Handler class is a parameterized type that is responsible for processing logging records sent to the Server from participating client hosts. When logging records arrive from the client host associated with a particular Logging Handler object, the handle_input() method of the Server_Logging_Handler class is called which in turn formats and displays the records on one or more output devices (such as the printer, persistent storage, and/or console devices.
- Server_Logging_Acceptor : The class Server_Logging_Acceptor allocates in its handle_input() routine a new instance of class Server_Logging_Handler on the heap, and accepts connections into this Server_Logging_Handler.
3.1 Startup configuration #
The only parameter that the Logging Server takes is a listen port number. You can specify a port number by passing a "-p " to the application. This can be done via the svc.conf file.
3.2 Examples #
Here is an example svc.conf entry that dynamically loads the Logging Server specifying port number to listen on for client connections:
dynamic Server_Logging_Service Service_Object * ../lib/netsvcs:_make_ACE_Server_Logging_Acceptor() "-p 10202"
3.3 Note #
- These files would vary if the services are run on NT. For example, instead of using *.so, we would have to use *.dll.
- Values for parameters can also be passed in using environment variables. For example, instead of specifying absolute hostname or port numbers in the config file, we can use $HOST and $PORT, respectively, in the file (assuming that these environment variables have been set).
- If the environment variable LD_LIBRARY_PATH (in the case of UNIX) or PATH (in the case of Win32) contains the path to the shared object files or dll, then the config file can be further simplified. Instead of specifying a path to the shared object or dll, only the name of the shared object or dll would suffice. That is, the Service Configurator makes use of LD_LIBRARY_PATH (on UNIX) or PATH (on Win32) to look for the shared object files or dlls.
4 Overview of Client Logging Service #
The Client Logging Service multiplexes messages recevied from different applications to the Server Logging Daemon running on a designated host in a network/internetwork. The following are the key classes in the Client Logging Service:
- Client_Logging_Handler : The Client_Logging_Handler class is a parameterized type that is responsible for setting up a named pipe and using it to communicate with different user processes on the same host. Once logging records arrive from these processes, the handler reads these records in priority order, performs network-byte order conversions on multiple-header fields, and then transmits these records to the Server Logging daemon across the network.
- Client_Logging_Connector : The class Client_Logging_Connector connects to the Server Logging daemon and then in its handle_input() routine it allocates a new instance of the Client_Logging_Handler on the heap.
4.1 Startup configuration #
Configuring a Logging Client requires specifying all or some of the following parameters. These parameters can be passed in to main through command line as follows:
| Option | Description | Default value |
| -h <hostname> | Hostname of the Server Logging Daemon | ACE_DEFAULT_SERVER_HOST |
| -p <port number> | Port number of the Server Logging Daemon | ACE_DEFAULT_LOGGING_SERVER_PORT |
| -p <rendezvous key> | Rendezvous key used to create named pipe | ACE_DEFAULT_RENDEZVOUS |
4.2 Examples #
Here is an example svc.conf entry that dynamically loads the Logging Client specifying host name and port number of the Logging Server:
dynamic Client_Logging_Service Service_Object * ../lib/netsvcs:_make_ACE_Client_Logging_Connector() "-h tango.cs.wustl.edu -p 10202"
4.3 Note #
- These files would vary if the services are run on NT. For example, instead of using *.so, we would have to use *.dll.
- Values for parameters can also be passed in using environment variables. For example, instead of specifying absolute hostname or port numbers in the config file, we can use $HOST and $PORT, respectively, in the file (assuming that these environment variables have been set). Instead of specifying a path to the shared object or dll, only the name of the shared object or dll would suffice. That is, the Service Configurator makes use of LD_LIBRARY_PATH (on UNIX) or PATH (on Win32) to look for the shared object files or dlls.
5 Overview of Logging Strategy Service #
The Logging Strategy Service can be used to control the output of all the network services. It can be invoked with certain flags that determine where the output of all the services should go. The Logging Strategy Service sets the flags in ACE_Log_Msg, which controls all the streams through macros such as ACE_DEBUG, ACE_ERROR, and ACE_ERROR_RETURN. If default behavior is required, the Logging Strategy Service need not be invoked or it can be invoked with no parameters.
5.1 Startup configuration #
Here are the command line arguments that can be given to the Logging Strategy Service:
-f <flag1>|<flag2>|<flag3> (etc...)
where a flag can be any of the following:
- STDERR : Write messages to stderr.
- LOGGER : Write messages to the local client logger deamon.
- OSTREAM : Write messages to the ostream that gets created by specifying a filename (see below)
- VERBOSE : Display messages in a verbose manner
- SILENT : Do not print messages at all
-s filenameIf the OSTREAM flag is set, this can be used to specify the filename where the output should be directed. Note that if the OSTREAM flag is set and no filename is specified, ACE_DEFAULT_LOGFILE will be used to write the output to.
5.2 Examples #
Here is an example svc.conf entry that dynamically loads the Logging Strategy Service specifying that the output be sent to STDERR:
To direct output only to STDERR, specify command line arguments as:
To direct output to both STDERR and a file called "mylog", specify command line arguments as:
dynamic Logging_Strategy_Service Service_Object * ../lib/netsvcs:_make_ACE_Logging_Strategy() "-f STDERR"
"-f STDERR"
"-f STDERR|OSTREAM -s mylog"
5.3 Note #
- These files would vary if the services are run on NT. For example, instead of using *.so, we would have to use *.dll.
- Values for parameters can also be passed in using environment variables. For example, instead of specifying absolute hostname or port numbers in the config file, we can use $HOST and $PORT, respectively, in the file (assuming that these environment variables have been set).
- If the environment variable LD_LIBRARY_PATH (in the case of UNIX) or PATH (in the case of Win32) contains the path to the shared object files or dll, then the config file can be further simplified. Instead of specifying a path to the shared object or dll, only the name of the shared object or dll would suffice. That is, the Service Configurator makes use of LD_LIBRARY_PATH (on UNIX) or PATH (on Win32) to look for the shared object files or dlls.








