The ADS.ClientCallback delegate is represents a callback method called when the server accepts a client. It takes an object as a parameter and returns an object. The value of the parameter and return depend on the server type.

Example

object HttpHttpsCallback(object info)
{
	return "You typed: '" + ((HttpListenerRequest)info).QueryString[0] + "'";
}
object DataCallback(object info)
{
	return File.ReadAllText(@"C:\ServerDir\" + (string)info);
}
object CustomCallback(object info)
{
	Thread t = new Thread(new ThreadStart(HandleClient));
	t.Start();
	clients.Add((TcpClient)info);
	threads.Add(t);
}

Last edited Jun 20, 2012 at 10:14 PM by nmertin, version 2

Comments

No comments yet.