Interface SocketHandler

All Superinterfaces:
SelectionKeyAware, SelectorRegistrationListener
All Known Implementing Classes:
LocalForwardingChannel, RemoteForwardingChannel, SocketConnection, SocketForwardingChannel, SSLContextConnection, SSLSocketConnection

public interface SocketHandler extends SelectorRegistrationListener, SelectionKeyAware
An interface used by the SelectorThread to notify an object of when a read or write event has occurred.
  • Method Details

    • initialize

      void initialize(ProtocolEngine engine, SshEngine daemon, SelectableChannel channel) throws IOException
      Initialise this socket with a ProtocolEngine and the current SshEngine.
      Parameters:
      engine - ProtocolEngine
      daemon - Daemon
      Throws:
      IOException
    • processReadEvent

      boolean processReadEvent()
      The selector is ready to be read.
      Returns:
      boolean indicating ??
    • processWriteEvent

      boolean processWriteEvent()
      The selector is ready to be written to.
      Returns:
      boolean
    • getInitialOps

      int getInitialOps()
      Returns the current operations the handler is interested in
      Returns:
      int
    • setThread

      void setThread(SelectorThread thread)
      Sets the selector thread this handler runs upon
      Parameters:
      thread -
    • addTask

      void addTask(ConnectionAwareTask task)
      Add a task to the executor
    • wantsWrite

      boolean wantsWrite()
      Tell the selector that the handler wants to write.
      Returns:
    • getSelectorThread

      SelectorThread getSelectorThread()
      Get the selector thread this handler is connected to.
      Returns:
    • getName

      String getName()
      A name for this Socket
      Returns:
    • getContext

      SshContext getContext()
      Get the current context
      Returns:
    • getConnection

      Connection<? extends SshContext> getConnection()
      Get the Connection for this handler
      Returns:
    • wantsRead

      boolean wantsRead()
      Tell the selector that the handler wants to read.
      Returns: