public interface RMIClientSocketFactory
RMIClientSocketFactory
实例通过RMI运行时用来获得RMI客户端套接字调用。远程对象可以用一个
RMIClientSocketFactory
当它创建/出口通过
java.rmi.server.UnicastRemoteObject
和
java.rmi.activation.Activatable
exportObject
构造函数或方法。
一个远程对象相关联的RMIClientSocketFactory
实例将被下载到客户端时,远程对象的引用是一个RMI调用发送。这RMIClientSocketFactory
将用于创建连接到远程对象的远程方法调用。
一个RMIClientSocketFactory
实例也可以与远程对象注册表使客户可以使用自定义的Socket通信与远程对象注册表相关。
此接口的实现应该是可序列化的,应实施Object.equals(java.lang.Object)
返回true
时通过实例表示相同的(功能相当的)客户端套接字工厂,和false
否则(它也应该贯彻Object.hashCode()
始终与Object.equals
实施)。
UnicastRemoteObject
,
Activatable
,
LocateRegistry
Modifier and Type | Method and Description |
---|---|
Socket |
createSocket(String host, int port)
创建一个连接到指定主机和端口的客户端套接字。
|
Socket createSocket(String host, int port) throws IOException
host
-主机名
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.