Book Image

Mastering ServiceStack

By : Andreas Niedermair
Book Image

Mastering ServiceStack

By: Andreas Niedermair

Overview of this book

Table of Contents (13 chapters)

RCON


The next step is to message across the process and machine boundaries, which is done by using the RCON service and client. The server and client are located in the ServiceStack.Server NuGet package (ServiceStack.Messaging.Rcon), as shown here:

This solution is a bit of an exception though; it neither involves an external broker to which you can assign multiple services, nor a persistence of messages. In fact the process that hosts a Server object is the broker, which makes RCON a perfect basis for a direct machine-to-machine communication to implement your own Message Queue. Another important issue with RCON is the non-existent storage of messages, that vanish when the service restarts.

using System;
using System.Net;
using ServiceStack;
using ServiceStack.Text;

const int port = 12345;
var ipEndPoint = new IPEndPoint(IPAddress.Any,
                                port);
var server = new ServiceStack.Messaging.Rcon.Server(ipEndPoint);
server.RegisterHandler<Hello>(message =>...