通过 VPN 连接失败

发布于 2024-12-14 01:01:59 字数 347 浏览 5 评论 0原文

我在开发MFC编程时遇到一个很奇怪的问题。

我在winsock.h 中使用connect() 函数来使用指定端口连接到我的服务器。 正常情况下一切正常,但是当我使用 VPN 时,我无法连接到我的服务器。 10060 返回 GetLastError() - 超时错误。

之后,我使用 ping 命令连接我的服务器 - 没问题,连接状态非常好 - 最多 400 毫秒。 因此,我使用 telnet 命令通过端口连接到我的服务器 - 我可以看到超时错误。

断开 VPN 后,远程网络运行良好。

这对我来说很奇怪... 我该如何解决这个问题?

有关更多信息:我正在使用 PacketiX,端口是 17006。

I have a very strange problem in developing MFC programming.

I used connect() function in winsock.h in order to connect to my server with specified port.
Everything is Okay in normal case, but when I used the VPN, then I could not connect to my server.
GetLastError() was returned by 10060 - timed out error.

After that, I used ping command to my server - that was Okay and the connection status was very good - at most 400ms.
So, I used telnet command to my server with the port - I could see the timed out error.

After I disconnected the VPN, telenet worked well.

It's strange for me...
How can I solve this?

For more info : I'm using PacketiX and the port is 17006.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

dawn曙光 2024-12-21 01:01:59

这可能与“套接字编程”无关,而与“网络配置”有关。

两种强烈的可能性:

  1. VPN 有防火墙阻止您的连接
    ...和/或...

  2. 您的内部 LAN 与 VPN 的 LAN 具有相同的网络号(例如,两个网络均为 192.1.168.xxx),并且当 VPN 开启时,堆栈无法正确路由。< /p>

还有其他可能性。

强烈建议:
获取 WireShark 的副本并跟踪通过线路进行的呼叫:

http://www.wireshark.org

This probably has nothing to do with "socket programming", and everything to do with "network configuration".

Two strong possibilities:

  1. The VPN has a firewall that's blocking your connection
    ... and/or ...

  2. Your internal LAN has the same network numbers as your VPN's LAN (e.g. 192.1.168.xxx for both networks) and the stack can't route correctly while the VPN is on.

There are other possibilities, too.

STRONG SUGGESTION:
Get a copy of WireShark and trace the calls going over the wire:

http://www.wireshark.org

风月客 2024-12-21 01:01:59

当我使用80端口时,一切正常。
也许 PacketiX 会阻止 17006 端口。

When I use 80 port, everything is okay.
Maybe PacketiX blocks 17006 port.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文