I am modifying the code in this tutorial to create the push client / subscription base classes of the push push server, and I just hit a little brick wall.
The server class in the tutorial is created using the following code:
class Program
{
static void Main(string[] args)
{
using (ServiceHost host = new ServiceHost(
typeof(StringReverser),
new Uri[]{
new Uri("net.pipe://localhost")
}))
{
host.AddServiceEndpoint(typeof(IStringReverser),
new NetNamedPipeBinding(),
"PipeReverse");
host.Open();
Console.WriteLine("Service is available. " +
"Press <ENTER> to exit.");
Console.ReadLine();
host.Close();
}
}
}
I assume I posted an instance of StringReverser . My problem is that I need a link to this instance, so I can call the method on it to return data to the client.
In the tutorial, the server simply responds to the client using the callback method, instead I save the link to the client in the list of subscribers. When I need to send data back to clients, I need a reference to a service object, so I really can use a callback.
WCF, ? ?
...