【发布时间】:2012-03-25 08:39:09
【问题描述】:
是否有可能让两台计算机通过套接字相互连接而无需使用 Java 中的任何服务器?如果是这样,怎么做?我只看到了服务器是永久的服务器-客户端连接的示例。
例如:
1. 2 people, person A and person B, want to connect using this application
2. Person A runs application, clicks "host"
3. Application hands person A a code (IP+port?) and begins listening.
4. Person B clicks "join" and types in code.
5. Person B's computer sees Person A's computer and they connect. Person A accepts connection.
我从来没有真正理解这一点。如果这是一个不好的问题,请原谅我。
【问题讨论】:
标签: java tcp port connect tcp-ip