Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » How to close Skylark server except using Ctrl+C
How to close Skylark server except using Ctrl+C [message #36887] Tue, 17 July 2012 04:46 Go to previous message
kasome is currently offline  kasome
Messages: 78
Registered: July 2008
Location: Taiwan
Member
Hello,

i am trying to use the Skylark to do something like the following

class WebServer : public SkylarkApp {
public:
	void StopServer();
	void StartServer();

};

class SimpleGUI : public TopWindow , public WebServer {
public:
	SimpleGUI() {
		StartServer();
	}
	
	virtual ~SimpleGUI() {
		StopServer();
	}
}


GUI operation for desktop user, and web operation for smart phone user.

so i try to modify the code, like

class WebServer : public SkylarkApp {
public:
	WebServer() {
		Run();
	}
	virtual ~WebServer(){
	}

	void StopServer() {
		TheApp().quit = true;

		TcpSocket h;
		h.Connect("127.0.0.1", TheApp().port);
		h.Put("quit");
		
	}
	void StartServer() {
		for( int i=0; i<threads; ++i ) {
			Thread::Start( THISBACK(ThreadRun) );
		}
	}
	
	virtual void Main() {
		
	}

};


and it didn't work apparently,

well, is there better way to close Skylark server except using Ctrl+C ?

[Updated on: Tue, 17 July 2012 05:03]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Skylark and GUI in one app - need some advices
Next Topic: Fatal error - GuiLock
Goto Forum:
  


Current Time: Sun Apr 28 15:27:55 CEST 2024

Total time taken to generate the page: 0.04429 seconds