简体   繁体   English

Java Client-Server连接没有端口转发?

[英]Java Client-Server connection without port forwarding?

I would like to implement a connection between two devices with Java. 我想用Java实现两个设备之间的连接。 Actually I am using ServerSockets and this implies that I have to use port forwarding because I want to connect the computers via public ip addresses. 实际上,我正在使用ServerSockets,这意味着我必须使用端口转发,因为我想通过公共IP地址连接计算机。 This works fine. 这很好。 But I would like to connect the devices without port forwarding or other changes on the router. 但是我想在不进行端口转发或路由器进行其他更改的情况下连接设备。 Is this possible? 这可能吗?

How should I connect the devices? 我应该如何连接设备? Might be a P2P Connecion the solution? 可能是P2P Connecion解决方案吗? Thanks in advance. 提前致谢。

I would like to connect the devices without port forwarding or other changes on the router. 我想在不进行端口转发或在路由器上进行其他更改的情况下连接设备。 Is this possible? 这可能吗?

Yes, don't go through the router. 是的,请勿通过路由器。 ie. 即。 access it on the internal network. 在内部网络上访问它。 If you are using the router, you have to configure it. 如果使用路由器,则必须对其进行配置。

How should I connect the devices? 我应该如何连接设备?

Without more details, I would suggest TCP is the simplest. 如果没有更多细节,我建议TCP是最简单的。

Might be a P2P Connecion the solution? 可能是P2P Connecion解决方案吗?

It might. 它可能。

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

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