本文整理汇总了Java中sun.rmi.transport.proxy.RMIMasterSocketFactory类的典型用法代码示例。如果您正苦于以下问题:Java RMIMasterSocketFactory类的具体用法?Java RMIMasterSocketFactory怎么用?Java RMIMasterSocketFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RMIMasterSocketFactory类属于sun.rmi.transport.proxy包,在下文中一共展示了RMIMasterSocketFactory类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createServerSocket
import sun.rmi.transport.proxy.RMIMasterSocketFactory; //导入依赖的package包/类
/** Create a server socket and remember which port it's on.
* Aborts if createServerSocket(0) is called twice, because then
* it doesn't know whether to remember the first or second port.
*/
public ServerSocket createServerSocket(int p)
throws IOException
{
ServerSocket ss;
ss = (new RMIMasterSocketFactory()).createServerSocket(p);
if (p == 0) {
if (servport != 0) {
System.err.println("TEST FAILED: " +
"Duplicate createServerSocket(0)");
throw new Error("Test aborted (createServerSocket)");
}
servport = ss.getLocalPort();
}
return (ss);
}