外部ip相关 [英] external ip related

查看:97
本文介绍了外部ip相关的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在外部IP中的C#中运行此Tcp/Ip聊天应用程序吗?现在,服务器在外部ip上,客户端在本地ip上吗?这样,我无法在线查看所有内容users.as所有本地m/c的公共ip具有相同的ip?

I want to run this Tcp/Ip chat application in c# in external IP?right now,Server is on external ip and client side on local ip''s?by this, i m n''t able to see all online users.as public ip''s of all local m/c''s have the same ip''s?

推荐答案

所有客户端将具有相同的IP地址因为它们位于NAT路由器后面,所以即使您知道客户端的本地IP地址也无济于事,因为这些地址在服务器所在的网络环境中毫无意义.
要查看所有联机用户,客户端需要连接到服务器并保持连接打开直到完成连接,而不是在发送单个消息之后.
如果这样做没有帮助,请解决您的问题,以便对您要实现的目标有所了解.
All clients will have the same IP address as they are behind a NAT router, even if you knew the local IP addresses of the clients it would not help you as those addresses make no sense in the context of the network the server is on.
To see all online users the clients need to connect to the server and keep the connection OPEN until they are finished with it, not after sending a single message.
If this doesn''t help please fix your question so that it makes some sense as far what you are trying to achieve.


最好是对程序使用SQL数据库来查看hu仍然在线,但您仍要使用GUID为用户添加到hev数据库
the best is to use SQL dataBase for your program to see hu is on line still you nide to hev database for your users with GUID


这篇关于外部ip相关的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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