简体   繁体   English

Java网络通讯问题

[英]Java network communication problem

I have a problem that I think might be a java related one. 我有一个可能与Java相关的问题。 I have a java application I need to emulate multiple hosts. 我有一个Java应用程序,我需要模拟多个主机。

The server/client work fine between "normal" computers. 服务器/客户端在“正常”计算机之间可以正常工作。

When I use the emulator, I get connection refused when client tries to connect to a server in the emulator, same thing if I try telnet. 当我使用仿真器时,当客户端尝试连接到仿真器中的服务器时,连接会被拒绝,如果尝试telnet,也会发生相同的情况。 If I turn it around, the client cannot connect to the external server, but if I telnet from the external server, I get a connection. 如果我转过来,客户端将无法连接到外部服务器,但是如果我从外部服务器进行telnet,则可以建立连接。

This makes me think it is a java related problem. 这使我认为这是与Java相关的问题。

Anybody gone through this problem before? 有人遇到过这个问题吗? This is for research purposes, so turning off java security only for this situation is no problem. 这是出于研究目的,因此仅在这种情况下关闭Java安全性是没有问题的。

Thanks! 谢谢!

When you say emulator, I think you are talking about a virtual machine. 当您说仿真器时,我认为您是在谈论虚拟机。 Connecting from the real world into a virtual machine is not something that works automatically. 从现实世界连接到虚拟机并不是自动进行的。 The virtual machine can initiate connections out because the virtualization software handles that. 虚拟机可以启动连接,因为虚拟化软件可以处理。 Going the other way - what machine name do you use. 换一种方式-您使用什么机器名。 How you configure your physical machine to routce packets to the ip address of your virtual machine (which your virtualization software made up). 如何配置物理机以将数据包路由到虚拟机的IP地址(由虚拟化软件组成)。 You may need a proxy on your physical machine to route the packets into the virtual one. 您可能需要在物理机上使用代理才能将数据包路由到虚拟机中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM