[Ace-users] [ace-bugs] netsvcs:"Name Service"; ACE::ACE_Naming_Context::init(int argc, ACE_TCHAR *argv) and ...
Vladislav
vladislav at gtss.spb.ru
Fri Dec 7 02:46:05 CST 2007
Hi
ACE VERSION: 5.6.1
HOST MACHINE and OPERATING SYSTEM: Win32
SYNOPSIS:
Wrong init ACE_Naming_Context when dynamically linked
DESCRIPTION:
line 102, Naming_Context.h consists:
// = Dynamic initialization hooks.
/// Initialize name options and naming context when dynamically
/// linked.
virtual int init (int argc, ACE_TCHAR *argv[]);
Implementation of this method is based on the parameter argv[0] - "process
name"
(see line 590, Naming_Context.cpp)
BUG:
but when using dynamically linked service, config parameters do not
contain the "argv[0] -> process_name".
MY PROPOSALS:
Doug, my proposal applies not only to correct the error
but to prevent such misunderstandings when using functions like
parse_args (int argc, ACE_TCHAR *argv[]) or init (int argc, ACE_TCHAR
*argv[])
in the future.
We need to simulate the command line main() function
and pass always, as the first parameter "supername" when using dynamic
svc.conf configuration.
as the "supername" can be used either dll/shared name, either Service_Object
reponame.
for example svc.conf line:
dynamic MySuperNameServer Service_Object *
netsvcsd:_make_ACE_Name_Acceptor() "-p 20222 -l ..\ -s test"
init string for Service_Object can be transformed:
either: "netsvcsd -p 20222 -l ..\ -s test"
either: "MySuperNameServer -p 20222 -l ..\ -s test".
I think the latest version of the most preferable.
I can spend a some time to eliminate errors in the Naming_Context.cpp
but may be required to change the default behavior of
ACE_Name_Options::parse_args.
IHMO more preferable to changing behavior ACE_Service_Config translating
params string.
One of the many merits of my favorites ACE is the flexibility and rapid
creation of the units,
as applicable or .exe or .dll context.
Regards,
____________________________________________
Vladislav Zverev
GTSS , St.Petersburg, Russia
More information about the Ace-users
mailing list