Interface IoSessionRecycler

All Known Implementing Classes:
ExpiringSessionRecycler

public interface IoSessionRecycler
A connectionless transport can recycle existing sessions by assigning an IoSessionRecycler to an IoService.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final IoSessionRecycler
    A dummy recycler that doesn't recycle any sessions.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    put(IoSession session)
    Called when the underlying transport creates or writes a new IoSession.
    recycle(SocketAddress remoteAddress, int port)
    Attempts to retrieve a recycled IoSession.
    void
    remove(IoSession session)
    Called when an IoSession is explicitly closed.
  • Field Details

    • NOOP

      static final IoSessionRecycler NOOP
      A dummy recycler that doesn't recycle any sessions. Using this recycler will make all session lifecycle events to be fired for every I/O for all connectionless sessions.
  • Method Details

    • put

      void put(IoSession session)
      Called when the underlying transport creates or writes a new IoSession.
      Parameters:
      session - the new IoSession.
    • recycle

      IoSession recycle(SocketAddress remoteAddress, int port)
      Attempts to retrieve a recycled IoSession.
      Parameters:
      remoteAddress - the remote socket address of the IoSession the transport wants to recycle.
      port - The port the Acceptor is listening on* @param port The port the Acceptor is listening on
      Returns:
      a recycled IoSession, or null if one cannot be found.
    • remove

      void remove(IoSession session)
      Called when an IoSession is explicitly closed.
      Parameters:
      session - the new IoSession.