【问题标题】:How to make UDP connection between three servers using Java RMI如何使用 Java RMI 在三台服务器之间建立 UDP 连接
【发布时间】:2014-02-02 19:41:25
【问题描述】:

我不太清楚如何通过将它们绑定到注册表(接口)来在单个文件中创建的三个服务器之间建立 UDP 连接。

目前我正在制作这样的服务器

public void exportServer() throws Exception
{
    Remote obj = UnicastRemoteObject.exportObject(this, 2021);
    Registry r = LocateRegistry.createRegistry(2021);
    r.bind("NA", obj);
}

public static void main(String args[]) throws Exception
{
    (new GameServer()).exportServer();
    System.out.println("Server is up and running");

}

我需要一些关于如何使用不同端口号创建三台服务器并通过 UDP 连接连接它们的指导。

【问题讨论】:

    标签: java sockets udp rmi


    【解决方案1】:

    你不能。 RMI 使用 TCP,而不是 UDP,“UDP 连接”在术语上是矛盾的。

    这个问题没有意义。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-28
      • 1970-01-01
      • 1970-01-01
      • 2014-07-04
      • 2013-03-20
      • 1970-01-01
      相关资源
      最近更新 更多