2

In Java, we can open a ServerSocket with new ServerSocket(port), and connect to it with new *Socket(server_adress",port)*;
But how to connect, if server is in a different network, while both networks are behind a NAT.

I know that there must be a solution. Skype and other applications already found it.

Any ideas ?

Regards, Andrew.

4

1 回答 1

1

有关所有方法的列表,其中一些由 Skype 使用,请参阅http://en.wikipedia.org/wiki/NAT_traversal

选择方法后,使用 Google 搜索该方法的 Java 实现。(或点击该 wiki 页面上的链接,例如http://jstun.javawi.de/

于 2011-02-24T18:47:35.310 回答