VMWare/Cygwin/Sockets环境下Netcat异常

发布于 2024-07-20 07:16:33 字数 528 浏览 1 评论 0原文

我很高兴在 XP 上托管的 VMWare 盒子中运行 Ubuntu Linux。

我的 Linux 应用程序打开您的基本服务器套接字端口,我将 netcat (nc) 作为客户端连接到该端口,以侦听我为“真实”客户端放置在该套接字上的流量。 一切都好。

但是,当我在 XP 端打开 Cygwin shell 并从那里运行 nc 时,它似乎无法连接到我的应用程序的服务器套接字。

不过,为了验证连接性,如果我在 Linux/VMWare 环境中将 nc 作为服务器运行 (nc -l -p 3694),Cygwin 上的 nc 可以毫无问题地连接到它并来回传输数据(IP 地址不是 localhost,而是 DHCP 分配的地址)。

总结一下:

Linux App      --  Linux nc  : Works
Linux App      --  Cygwin nc : Does not work
Linux nc (svr) --  Cygwin nc : Works

I'm happily running Ubuntu Linux in a VMWare box hosted on XP.

My Linux application opens up your basic server socket port, to which I connect netcat (nc) as a client to listen in on the traffic I'm putting on that socket for the "real" clients. All's well.

However, when I open up a Cygwin shell on the XP side and run nc from there it appears to be unable to connect to my application's server socket.

To verify connectivity, though, if I run nc as a server (nc -l -p 3694) in the Linux/VMWare environment, nc on Cygwin has no trouble connecting to it and transferring data back and forth (the IP address is not localhost, it's the one assigned by DHCP).

To summarize:

Linux App      --  Linux nc  : Works
Linux App      --  Cygwin nc : Does not work
Linux nc (svr) --  Cygwin nc : Works

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

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

发布评论

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

评论(2

走野 2024-07-27 07:16:33

您使用的是哪个 netcat 代码? 至少一种变体存在已知问题......

Which netcat code are you using? At least one variant has known issues...

时光倒影 2024-07-27 07:16:33

是否有可能您将访客网络设置为 NAT,因此无法连接到虚拟机中侦听的网络?

Is it possible you have the guest network set to NAT and therefore things can't connect to something listening in the VM?

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