public interface SocketHandler extends SelectorRegistrationListener, SelectionKeyAware
SelectorThread to notify an object
of when a read or write event has occurred.| Modifier and Type | Method and Description |
|---|---|
void |
addTask(ConnectionAwareTask task)
Add a task to the executor
|
Connection<? extends SshContext> |
getConnection()
Get the Connection for this handler
|
SshContext |
getContext()
Get the current context
|
int |
getInitialOps()
Returns the current operations the handler is interested in
|
java.lang.String |
getName()
A name for this Socket
|
SelectorThread |
getSelectorThread()
Get the selector thread this handler is connected to.
|
void |
initialize(ProtocolEngine engine,
SshEngine daemon,
java.nio.channels.SelectableChannel channel)
Initialise this socket with a
ProtocolEngine and the current
SshEngine. |
boolean |
processReadEvent()
The selector is ready to be read.
|
boolean |
processWriteEvent()
The selector is ready to be written to.
|
void |
setThread(SelectorThread thread)
Sets the selector thread this handler runs upon
|
boolean |
wantsRead()
Tell the selector that the handler wants to read.
|
boolean |
wantsWrite()
Tell the selector that the handler wants to write.
|
registrationCompletedsetSelectionKeyvoid initialize(ProtocolEngine engine, SshEngine daemon, java.nio.channels.SelectableChannel channel) throws java.io.IOException
ProtocolEngine and the current
SshEngine.engine - ProtocolEnginedaemon - Daemonjava.io.IOExceptionboolean processReadEvent()
boolean processWriteEvent()
int getInitialOps()
void setThread(SelectorThread thread)
thread - void addTask(ConnectionAwareTask task)
boolean wantsWrite()
SelectorThread getSelectorThread()
java.lang.String getName()
SshContext getContext()
Connection<? extends SshContext> getConnection()
boolean wantsRead()
Copyright © 2021. All rights reserved.