ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
what do aw_init() and aw_term() do? (Sdk)
what do aw_init() and aw_term() do? // SdkscifairAug 8, 2002, 11:01am
Hi,
I am running bots as a Win32 service, and I wonder what I need to do to restart a bot. 1. Can you call aw_init(), then aw_term(), the aw_init() again? 2. Is it impossible for the initializations done in aw_init() to run amuck so that a service could reliably reload itself just by killing the bot with aw_destroy() and creating it again? Right now, I run the bot as a child process of the service so that I can cleanly unload and load it again. It is safest, but running the whole service as one process would be cleaner and more configurable. Also, aw_init() accepts an argument which is the current build of the SDK. It does not return an error if you pass the wrong build number. This implies that you can link against build 22 and later, maybe, run against build 27 of aw.dll. That means the SDK internally keeps lists of the various AW_ATTRIBUTES and other enums from old builds so it can translate to the current SDK? Or does it fail silently? Thank You, Drew tony mAug 8, 2002, 12:22pm
[View Quote]
>Hi,
> >I am running bots as a Win32 service, and I wonder what I need to do to >restart a bot. > 1. Can you call aw_init(), then aw_term(), the aw_init() again? Yes. > 2. Is it impossible for the initializations done in aw_init() to run amuck >so that a service could reliably reload itself just by killing the bot with >aw_destroy() and creating it again? What do you mean by "run amuck"? >Right now, I run the bot as a child process of the service so that I can >cleanly unload and load it again. It is safest, but running the whole >service as one process would be cleaner and more configurable. > >Also, aw_init() accepts an argument which is the current build of the SDK. >It does not return an error if you pass the wrong build number. This It does return an error if the build number you passed and the number in AW.DLL don't match (error 454: RC_VERSION_MISMATCH) >implies that you can link against build 22 and later, maybe, run against >build 27 of aw.dll. That means the SDK internally keeps lists of the >various AW_ATTRIBUTES and other enums from old builds so it can translate to >the current SDK? Or does it fail silently? > >Thank You, >Drew scifairAug 8, 2002, 1:32pm
Thanks for the advice. I am just trying to figure out whether the
appropriate way to restart a Windows service for the AW SDK is to restart a child process, thread, or just the bot. Since it is possible to initialize and terminate a second time cleanly, then restarting the thread is an easy-enough option. I didn't mean anything bad by my phrase "running amuck," just that typical problems requiring service restarts are related to memory allocation or the state of the network communications, and destroying all of the bots does not promise to reset either. The VERSION_MISMATCH error is simple, too. I missed it running through the list. Thanks Again, Drew |