Created
August 26, 2016 19:20
-
-
Save aidapsibr/ae7ab64cba31a718ac0ba96c3871e580 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var endPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 5467); | |
var parser = new StompParser(); | |
using(var reStompService = new StompService(endPoint, parser)) | |
{ | |
reStompService.Start((middlewareStack) => | |
{ | |
middlewareStack.Push(new TerminationMiddleware().Invoke); | |
middlewareStack.Push(new ProtocolVersionMiddleware().Invoke); | |
middlewareStack.Push(new SessionMiddleware().Invoke); | |
middlewareStack.Push(new SendMiddleware().Invoke); | |
}); | |
Console.WriteLine("Service started."); | |
var client = new StompClient(); | |
var session = client.Connect("127.0.0.1", 5467).Result; | |
if(session != null) | |
{ | |
client.Send(new Dictionary<string,string> { ["receipt-id"] = "111" }, "WOO!").Wait(); | |
} | |
Console.ReadLine(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment