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 » What's wrong with this code?
What's wrong with this code? [message #38215] Fri, 07 December 2012 04:01 Go to previous message
lectus is currently offline  lectus
Messages: 329
Registered: September 2006
Location: Brazil
Senior Member
Why doesn't it compile?

#include "ServerTest.h"


void ServerTest::Accept(TcpSocket s)
{
	s.Put("Hello world!\n");
}

void ServerTest::Serve() {
	TcpSocket server;
	if(!server.Listen(8080))
	{
		Exclamation("Error!");
		return;
	}
	TcpSocket s;
	s.Accept(server);
	Thread().Run(callback1(Accept, s));
	
}

void ServerTest::BStartPush()
{
	Thread().Run(callback(Serve));
}




ServerTest::ServerTest()
{
	CtrlLayout(*this, "Window title");
	bStart.WhenPush = THISBACK(BStartPush);

}

GUI_APP_MAIN
{
	ServerTest().Run();
}

[Updated on: Fri, 07 December 2012 04:02]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic: Witz and map variable
Next Topic: Witz and Skylark weird behaviour (possibly a bug)
Goto Forum:
  


Current Time: Sun Apr 28 14:17:09 CEST 2024

Total time taken to generate the page: 0.09492 seconds