我正在通过 Internet 从 Windows 应用程序向 asp.net Web 服务发送由 xml 组成的小消息(每条大约 1-2 KB)。
99% 的时间都可以正常工作,但有时一条消息会花费过多的时间才能到达,需要 25 - 30 秒,而不是通常的 4 - 5 秒。这种延迟还会导致消息到达时乱序。
我是否可以解决这个问题,以便所有消息都能快速按顺序到达,或者以这种方式使用网络服务时是否无法保证?
如果无法解决,请推荐一个可以在互联网上按顺序传递消息的低延迟消息传递框架。
谢谢。
最佳答案
Is there anyway i can solve this issue so that all the messages arrive quickly and in squence or is that not possible to gurantee when using a web service in this manner ?
仅使用网络服务是不可能的。你总是会遇到这样的情况,偶尔有些事情会比它“应该”花费更长的时间。这是网络编程的本质,您必须解决它。
我还建议使用 XMPP 来做类似的事情。看看xmpp.org有关标准的信息和 jabber-net用于 .Net 的一组客户端库。
关于asp.net - 通过 Internet 在 .net 应用程序之间发送数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5703526/