ServerEvents - Last message not being recieved until heartbeat

扶醉桌前 提交于 2019-12-11 14:32:34

问题


Extension on : Original post

We are having an issue where the last message sent over server events is not being revieved until the next heartbeat. The client in question is using the Service Stack Typscript Client

Here is a stripped down implimentation of the server setup / calls

As suggested in the original post, we have upgraded to 5.7 AND switched over the the async api and it still waits for the next heartbeat.

The c# implimentation for a this works without the delay against the same server. Below is the relevant code from that :

public class Events
{
    public async Task Setup(string channel)
    {
       _client = new ServerEventsClient(_baseUri.ToString(), channel);
       _client.OnJoin += OnJoin;
       _client.OnConnect += OnConnect;
       _client.OnCommand += OnCommand;
       _client.OnMessage += OnMessage;
       _client.OnException += OnException;
       _client.Start();
       _ = _client.Connect();
       //
       _log.Text = $"{DateTime.Now} : [Connected] : {channel.ToString()} \n {_log.Text}";
       // Wait to receive onJoin command event
       var joinMsg = await _client.WaitForNextCommand();
    }

    private void OnMessage(ServerEventMessage e)
    {
        AddToLog($"[Message Received] {e.Data}");
    }
 }

来源:https://stackoverflow.com/questions/58202564/serverevents-last-message-not-being-recieved-until-heartbeat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!