Subject AW: [firebird-support] Command line options
Author Klement Guenther - Munich-MR
> Actually what my requirement is that I want to start fbserver
> whenever my
> client application starts and stop it when the user quits the client
> application. It should be very much transparent to the
> client. Therefore,
the fbserver should have an option to handle the shutdown well.

There seems to be a need for an autostop option in fbserver, Isn't it?

> //If we started the process, lets attempt to terminate it
> as well....
> if( s_pi.hProcess != NULL && s_pi.hThread != NULL )
> {
> TerminateProcess( s_pi.hProcess, 0 );
> CloseHandle( s_pi.hThread );
> CloseHandle( s_pi.hProcess );
> }
> }

This might be slightly better, but my leave the fbserver running.
void db_test_stop_local_server(char* user, char* passwd)
{
HWND hWnd = NULL;
disconnect();
// check if there are other connections via isc_info_svc_svr_db_info
if (db_cnt_active_attachments(user, passwd) == 0 )
{
hWnd = FindWindow(szClassName, APP_NAME);
if (hWnd) {
PostMessage(hWnd, WM_CLOSE, 0, 0);
}
}

Regards
Guenther