public class RpcSocketPool extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
RpcSocketPool.ShutdownHandler
Shutdown handler for cleaning up before a socket is closed
|
| Constructor and Description |
|---|
RpcSocketPool(int poolSize,
String host,
int port,
Properties socketProperties,
RpcSocketPool.ShutdownHandler shutdownHandler)
Create a new socket pool with a max pool size, host, port, and socket
properties, and an optional shutdown handler
|
RpcSocketPool(int poolSize,
String host,
int port,
Properties socketProperties,
RpcSocketPool.ShutdownHandler shutdownHandler,
boolean secure)
Create a new socket pool indicating whether it is secure (SSL) or not.
|
| Modifier and Type | Method and Description |
|---|---|
Socket |
acquire()
Acquire a socket to the configured server address
|
void |
disconnect()
Disconnect all sockets from the specified host and port
|
void |
release(Socket socket,
RpcSocketPool.ShutdownHandler shutdownHandler)
Release a socket back to the pool as no longer using
|
void |
timeout(int idleDuration)
Timeout any sockets idle for greater than or equal to the milliseconds
value specified
|
public RpcSocketPool(int poolSize,
String host,
int port,
Properties socketProperties,
RpcSocketPool.ShutdownHandler shutdownHandler,
boolean secure)
poolSize - host - port - socketProperties - shutdownHandler - secureServer - public RpcSocketPool(int poolSize,
String host,
int port,
Properties socketProperties,
RpcSocketPool.ShutdownHandler shutdownHandler)
poolSize - host - port - socketProperties - shutdownHandler - public Socket acquire() throws IOException
IOExceptionpublic void release(Socket socket, RpcSocketPool.ShutdownHandler shutdownHandler) throws IOException
socket - shutdownHandler - IOExceptionpublic void disconnect()
public void timeout(int idleDuration)
idleDuration - Copyright © 2017 Perforce Software. All Rights Reserved.