如何使用C#套接字一次向两个客户端发送消息? [英] How to send message to two clients at a time using C# socket?

查看:195
本文介绍了如何使用C#套接字一次向两个客户端发送消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用C#socket开发了简单的客户端服务器应用程序。我一次向两个客户发送消息,客户正确接收消息。但是,如果其中一个客户端使用慢速网络,那么客户端会收到延迟响应。我想客户应该从任何网络和任何类型的设备同时接收消息。



请帮助我。

提前谢谢。

I have developed simple client server application using C# socket. I am sending messages to two clients a a time and clients receiving it properly. But, in case one of the client using slow network then client receiving late response. I want to client should receive messages at a same time from any network and any type of device.

Please help me on .
Thanks in advance.

推荐答案

根据我的说法,如果网络很慢,很明显这条消息接收时间会有所不同。



注意:在告知客户端PC的网络速度慢之前,尝试 ping 任何网站并检查是否它真的很慢,或者你的代码几乎没有修改。
According to me if the network is slow it is obvious that the message receive time would vary.

Note : Before telling that the network of client's PC is slow try to ping any website and check if it is really slow or there are little amendments to be made to your code.


这篇关于如何使用C#套接字一次向两个客户端发送消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆