C#TCP客户端/服务器远程连接问题 [英] C# TCP Client / Server remote connection problem

查看:233
本文介绍了C#TCP客户端/服务器远程连接问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我收到以下异常:

连接尝试失败,因为连接方未能正确响应一段时间,或建立的连接失败,因为连接的主机无法响应...。

播放状态:

客户端和服务器是用C#编写的。

3台远程电脑,让我们拨打A(Seven Ultimate),B(Seven Family)和C(XP专业版)。

我在PC上做了端口转换NAT 3 。

A和B有一个通过DHCP配置的静态IP(我不知道它是否真的有用)。

客户端/服务器在3台PC上的本地工作非常好,所以我不认为这是一个编程问题。



服务器A,客户端B无法工作(例外)。

客户端A ,服务器B工作。

服务器A,客户端C工作。

客户端A,服务器C不工作(例外)。



我没有任何问题地ping A和B,并且(无论出于何种原因)不是C(但我无法访问这台机器,这是朋友的电脑),我不知道这些信息是否有用。



我无法理解为什么配置服务器A /客户端B和客户端A /服务器C不起作用,而相反的是...



所以,如果有人有想法不要犹豫......

提前感谢您的帮助。

Hello,

I get the following exception:
"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ...".
State of play:
The client and server are written in C #.
3 remote computers, lets call A (Seven Ultimate), B (Seven Family) & C (XP Pro).
I did the port translation NAT on the PC 3.
A and B have a static IP configured via DHCP (I do not know if it's really useful).
Client / server work perfectly well in local on the 3 PC, so I do not think it is a programming problem.

Server A, Client B does not work (Exception).
Client A, Server B works.
Server A, Client C works.
Client A, Server C does not work (Exception).

I ping A and B without any problem, and (for whatever reason) not C (but I do not have access to this machine, this is a friend's computer), I do not know if this information may be useful.

I can not understand at all why the configurations server A / Client B and Client A / Server C does not work while the opposite yes...

So, if someone has an idea don't hesitate ...
Thank you in advance for your help.

推荐答案

hi,



如果你想要安全,请检查连接是否在每台机器上安装wireshark软件,并验证因ping不够而发送/接收的数据包。



祝你好运



jeremy


If you want to be safe check the connection install the wireshark software on each machine and to verify that packets sent/received because the ping is not enough.

good luck

jeremy


这篇关于C#TCP客户端/服务器远程连接问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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