public void ReceivedUpdate(ChatUpdate response) { Console.WriteLine(response.Id + "->" + response.Message); Console.WriteLine(); OnUpdated(new UpdateEventArgs(response.Id, response.Message)); //_mainWindow.UpdateReceivedMessage(response.Id, response.Message); }
public override ResponseMessage PerformService(Scope <object> clientSessionScope) { var sessionManagerMap = (DictionaryList <object, WebSocketClientSessionManager>) clientSessionScope.Get(SessionObjects.SessionsMap); string sessionId = (string)clientSessionScope.Get(SessionObjects.SessionId); ChatUpdate messageUpdate = new ChatUpdate(message, sessionId); foreach (WebSocketClientSessionManager otherClient in sessionManagerMap.Values) { Console.WriteLine(otherClient.SessionId + "Checking to make sure not " + sessionId); if (!otherClient.SessionId.Equals(sessionId)) { otherClient.SendUpdateToClient(messageUpdate, otherClient.SessionId); } } return(OkResponse.ReusableInstance); }
public override ResponseMessage PerformService(Scope<object> clientSessionScope) { var sessionManagerMap = (DictionaryList<object, WebSocketClientSessionManager>) clientSessionScope.Get(SessionObjects.SessionsMap); string sessionId = (string) clientSessionScope.Get(SessionObjects.SessionId); ChatUpdate messageUpdate = new ChatUpdate(message, sessionId); foreach (WebSocketClientSessionManager otherClient in sessionManagerMap.Values) { Console.WriteLine(otherClient.SessionId + "Checking to make sure not " + sessionId); if (!otherClient.SessionId.Equals(sessionId)) { otherClient.SendUpdateToClient(messageUpdate, otherClient.SessionId); } } return OkResponse.ReusableInstance; }