关于使用TCP的客户端服务器应用程序 [英] Regarding Client Server Application Using TCP

查看:86
本文介绍了关于使用TCP的客户端服务器应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我已经在vb.net中编写了客户端服务器应用程序.它工作正常.当客户端发送一条消息时,该消息将被服务器接收,但是当服务器发送一条答复时,该消息将被所有客户端接收并显示.
我需要的是,我需要向连接了多个客户端的特定客户端发送回复.
为此,我该怎么办?请建议我...

Hi all,
I have written client server application in vb.net.It is working correctly.when client sends a message,that will received by the server,but when server sends a reply that will received by all the clients and displayed.
What i need is, i need to send reply to particular client where multiple clients are connected.
For that what shall i do?Please suggest me...

推荐答案

服务器通常以REQUEST/RESPONSE的形式实现,您在说的是服务器发起请求特定客户.

为此,您可以执行以下操作:
1)在客户端和服务器上设置反向过程,其中服务器是客户端,客户端是服务器.

2)实现一种轮询机制,在该机制中,客户端向服务器发送请求并为其获取消息(例如每5秒发送一次).

选项2更好.
Servers are usually implemented as REQUEST/RESPONSE, what you are talking about is the server initiating a request to a specific client.

For this you can do the following :
1) Setup the reverse process on the client and server where the server is the client and the client is the server.

2) Implement a polling mechanism where the clients send a request to the server and gets the messages for it (say every 5 sec).

Option 2 is better.


这篇关于关于使用TCP的客户端服务器应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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