public abstract static class LoadBalancer.SocketHandler extends Daemon
Daemon.DaemonWorker
Base.LoggingWriter, Base.StackFrame
Modifier and Type | Field and Description |
---|---|
protected byte[] |
m_abBuf
The buffer to use for reading from a stream.
|
Constructor and Description |
---|
SocketHandler(String sName)
Construct a SocketHandler with a given daemon thread name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
copy(InputStream streamIn,
OutputStream streamOut,
byte[] abBuf)
Process the transfer of data from one stream to another.
|
protected byte[] |
ensureBuffer(Socket socket)
Return the existing buffer, if there is one, or create one to use
for reading from the passed socket.
|
protected void |
process(Socket socketIn,
Socket socketOut)
Process the transfer of data from one socket to another.
|
abstract void |
run()
Processing loop for the SocketHandler.
|
changeState, configureWorker, ensureThreadGroup, finishStarting, finishStopping, getConfiguredName, getConfiguredPriority, getContext, getDescription, getGuardRegisterAction, getMaxWaitMillis, getState, getThread, getThreadContextClassLoader, getWorker, guardIfNeeded, heartbeat, heartbeat, instantiateWorker, isGuarded, isOnWorkerThread, isRunning, isStopping, recover, setConfiguredName, setConfiguredPriority, setContext, setGuardPolicy, setGuardRegisterAction, setThreadContextClassLoader, shutdown, start, stop, terminate, toStateString, toString
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
public SocketHandler(String sName)
public abstract void run()
protected void process(Socket socketIn, Socket socketOut) throws IOException
socketIn
- the socket to read fromsocketOut
- the socket to write toIOException
protected void copy(InputStream streamIn, OutputStream streamOut, byte[] abBuf) throws IOException
streamIn
- the stream to read fromstreamOut
- the stream to write toabBuf
- the byte array to use as a buffer to read into
and write fromIOException
protected byte[] ensureBuffer(Socket socket)
socket
- the socket that the buffer will be used to read from