protected class RpcClient.Connection extends Thread
Modifier and Type | Class and Description |
---|---|
protected class |
RpcClient.Connection.PingInputStream
This class sends a ping to the remote side when timeout on
reading.
|
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected ConcurrentSkipListMap<Integer,RpcClient.Call> |
calls |
protected IOException |
closeException |
protected DataInputStream |
in |
protected AtomicLong |
lastActivity |
protected DataOutputStream |
out |
protected RpcClient.ConnectionId |
remoteId |
protected AtomicBoolean |
shouldCloseConnection |
protected Socket |
socket |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Modifier and Type | Method and Description |
---|---|
protected void |
addCall(RpcClient.Call call)
Add a call to this connection's call queue and notify
a listener; synchronized.
|
protected void |
cleanupCalls() |
protected void |
cleanupCalls(long rpcTimeout) |
protected void |
close()
Close the connection.
|
protected void |
closeConnection() |
InetSocketAddress |
getRemoteAddress() |
protected void |
markClosed(IOException e) |
protected void |
readResponse() |
void |
run() |
protected void |
sendPing() |
protected void |
setupConnection() |
protected void |
setupIOstreams() |
protected void |
touch()
Update lastActivity with the current time.
|
protected boolean |
waitForWork() |
protected void |
writeRequest(RpcClient.Call call,
int priority)
Initiates a call by sending the parameter to the remote server.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
protected RpcClient.ConnectionId remoteId
protected Socket socket
protected DataInputStream in
protected DataOutputStream out
protected final ConcurrentSkipListMap<Integer,RpcClient.Call> calls
protected final AtomicLong lastActivity
protected final AtomicBoolean shouldCloseConnection
protected IOException closeException
protected void touch()
protected void addCall(RpcClient.Call call)
call
- to addprotected void setupConnection() throws IOException
IOException
protected void closeConnection()
protected boolean waitForWork()
public InetSocketAddress getRemoteAddress()
protected void sendPing() throws IOException
IOException
protected void setupIOstreams() throws IOException, InterruptedException
IOException
InterruptedException
protected void close()
protected void writeRequest(RpcClient.Call call, int priority)
call
- priority
- readResponse()
protected void readResponse()
protected void markClosed(IOException e)
protected void cleanupCalls()
protected void cleanupCalls(long rpcTimeout)
Copyright © 2014 The Apache Software Foundation. All Rights Reserved.