【发布时间】: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 连接连接它们的指导。
【问题讨论】: