void Test1Byte( void ) /*FOLD00*/ { uint32_t responce; uint32_t reslen = 4096; int n; uint32_t sec = time(NULL); while( (sec+5) > time(NULL) ) //for( n = 0; n < 10000; n++ ) { SetTick( l.start ); if( !TransactServerMessage( l.MsgBaseClient + MSG_Test1 , l.data, 1 , &responce, l.data_in, &reslen ) ) { printf( WIDE("Transact message generally failed - suppose that's a timeout.\n") ); } else { if( responce & 0x80000000 ) lprintf( WIDE("Responce was faillure from the server...") ); else { uint64_t del; SetTick( l.end ); l.accum += (del = l.end - l.start); l.passes++; l.bytes += reslen; if( (!l.min) || (del < l.min) ) l.min = del; if( del > l.max ) l.max = del; l.waiting = 0; } } } DumpStats(); }
CLIENTMSG_PROC( void, UnloadService )( CTEXTSTR name ) { PEVENTHANDLER pHandler; pHandler = g.pHandlers; while( pHandler ) { if( StrCaseCmp( pHandler->servicename, name ) == 0 ) break; pHandler = pHandler->next; } if( pHandler ) { MSGIDTYPE Responce; //lprintf( WIDE("Unload service: %s"), pHandler->servicename ); if( pHandler->flags.local_service ) { //lprintf( WIDE("Local service... resulting quick success...") ); Responce = (MSG_ServiceUnload)|SERVER_SUCCESS; } else { //lprintf( WIDE("Requesting message %d from %d "), MSG_ServiceUnload , pHandler->MsgBase ); Responce = ((MSG_ServiceUnload)|SERVER_SUCCESS); if( !TransactServerMessage( &pHandler->RouteID , MSG_ServiceUnload, NULL, 0 , &Responce/*NULL*/, NULL, 0 ) ) { lprintf( WIDE("Transaction to ServiceUnload failed...") ); } else if( Responce != ((MSG_ServiceUnload)|SERVER_SUCCESS) ) { lprintf( WIDE("Server reports it failed to unload the service %08") _MsgID_f WIDE(" %08") _MsgID_f WIDE("") , Responce, (MSGIDTYPE)((MSG_ServiceUnload)|SERVER_SUCCESS) ); // no matter what the result, this must still release this // resource.... //return; } while( pHandler->flags.dispatched ) { Relinquish(); } } UnlinkThing( pHandler ); //lprintf( WIDE("Release? wow release hangs forever?") ); //Release( pHandler ); if( 0 && !g.pHandlers ) { Log( WIDE("No more services loaded - killing threads, disconnecting") ); if( g.pLocalEventThread ) { EndThread( g.pLocalEventThread ); // wake up the thread... } if( g.pEventThread ) EndThread( g.pEventThread ); if( g.pThread ) EndThread( g.pThread ); CloseMessageQueues(); g.flags.events_ready = 0; g.flags.local_events_ready = 0; g.flags.failed = 0; g.flags.message_handler_ready = 0; g.flags.message_responce_handler_ready = 0; } //Log( WIDE("Done unloading services...") ); return; } Log( WIDE("Service was already Unloaded!?!?!?!?!?") ); }