Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering ServiceStack

You're reading from   Mastering ServiceStack Utilize ServiceStack as the rock solid foundation of your distributed system

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher Packt
ISBN-13 9781783986583
Length 216 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Andreas Niedermair Andreas Niedermair
Author Profile Icon Andreas Niedermair
Andreas Niedermair
Arrow right icon
View More author details
Toc

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:

RCON

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 =&gt...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image