2004-04-01 15:12:36 +04:00
|
|
|
//-----------------------------------------------------------------------
|
|
|
|
// This software is part of the OpenBeOS distribution and is covered
|
|
|
|
// by the OpenBeOS license.
|
|
|
|
//
|
|
|
|
// Copyright (c) 2004 Waldemar Kornewald, Waldemar.Kornewald@web.de
|
|
|
|
//-----------------------------------------------------------------------
|
|
|
|
|
2004-04-15 20:05:40 +04:00
|
|
|
#include "NetServer.h"
|
2004-04-01 15:12:36 +04:00
|
|
|
#include <Application.h>
|
|
|
|
#include <Alert.h>
|
|
|
|
|
|
|
|
|
2004-04-15 20:05:40 +04:00
|
|
|
static const char *kSignature = NET_SERVER_SIGNATURE;
|
2004-04-01 15:12:36 +04:00
|
|
|
|
|
|
|
|
|
|
|
class NetServerApplication : public BApplication {
|
|
|
|
public:
|
|
|
|
NetServerApplication();
|
|
|
|
|
|
|
|
virtual void AboutRequested();
|
|
|
|
virtual void ReadyToRun();
|
|
|
|
// loads add-ons
|
|
|
|
virtual bool QuitRequested();
|
|
|
|
// unloads add-ons
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
|
|
|
new NetServerApplication();
|
|
|
|
|
|
|
|
be_app->Run();
|
|
|
|
|
|
|
|
delete be_app;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NetServerApplication::NetServerApplication()
|
|
|
|
: BApplication(kSignature)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
NetServerApplication::AboutRequested()
|
|
|
|
{
|
|
|
|
// the alert should not block because we might get _very_ important messages
|
|
|
|
(new BAlert("About...",
|
|
|
|
"OpenBeOS net_server\n\n"
|
|
|
|
"The net_server manages all userland tasks that "
|
|
|
|
"cannot be handled by the netstack.",
|
|
|
|
"Uhm...Cool?", NULL, NULL, B_WIDTH_AS_USUAL,
|
|
|
|
B_INFO_ALERT))->Go(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
NetServerApplication::ReadyToRun()
|
|
|
|
{
|
|
|
|
// load integrated add-ons
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: load add-on binaries
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool
|
|
|
|
NetServerApplication::QuitRequested()
|
|
|
|
{
|
|
|
|
// unload integrated add-ons
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: unload add-on binaries
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|