public interface RMIServerSocketFactory
RMIServerSocketFactory实例,以获取RMI调用的服务器套接字。
远程对象可以与相关联RMIServerSocketFactory经由构造或出口时被创建/ exportObject的方法java.rmi.server.UnicastRemoteObject和java.rmi.activation.Activatable 。
使用与远程对象相关RMIServerSocketFactory实例来获取用于接收来自客户端的来电的ServerSocket 。
RMIServerSocketFactory实例也可以与远程对象注册表关联,以便客户端可以使用与远程对象注册表的定制套接字通信。
此接口的实现应该实现Object.equals(java.lang.Object)返回true当传递表示相同(功能上等效)服务器套接字工厂,以及一个实例false否则(它也应该实现Object.hashCode()凭借其一贯Object.equals实现)。
UnicastRemoteObject , Activatable , LocateRegistry
| Modifier and Type | Method and Description |
|---|---|
ServerSocket |
createServerSocket(int port)
在指定端口上创建服务器套接字(端口0表示匿名端口)。
|
ServerSocket createServerSocket(int port) throws IOException
port - 端口号
IOException - 如果在创建服务器套接字期间发生I / O错误
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.