コード例 #1
0
        public void SerialiseDummyEventToExpectedFormat()
        {
            var dummyEvent = this.GetDummyEvent();
            string expectedMessage =
            @"content-type:application/vnd.meungblut.websockets.dummyevent+json

            {""id"":""6a8d7bcb-4d16-4b22-af52-60be3860ab86"",""someData"":""some data""}";
            var serialiser = new WebSocketDataSerialisation();
            var serialisedMessage = serialiser.GetString(dummyEvent);
            Assert.AreEqual(expectedMessage, serialisedMessage);
        }
コード例 #2
0
 public void SendMessage(string webSocketId, IDomainEvent domainEvent)
 {
     var serialiser = new WebSocketDataSerialisation();
     this.managers[webSocketId].BroadcastToAllClients(serialiser.GetString(domainEvent));
 }
コード例 #3
0
 public static void SendMessage(IDomainEvent domainEvent)
 {
     var serialiser = new WebSocketDataSerialisation();
     superWebsocketManager.BroadcastToAllClients(serialiser.GetString(domainEvent));
 }