Interface Window

All Known Implementing Classes:
SimpleWindow

public interface Window
This class does model a sliding window in the Go-Back-N ARQ protocol.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(GoBackNArqData msg, io.netty.channel.ChannelPromise promise)
    Adds the given msg to the window, if there is enough capacity.
    int
     
     
    io.netty.channel.ChannelPromise
    Removes the oldest message from the window.
    void
    Clears the window and let's fail all write promises.
    int
     
  • Method Details

    • add

      boolean add(GoBackNArqData msg, io.netty.channel.ChannelPromise promise)
      Adds the given msg to the window, if there is enough capacity.
      Parameters:
      msg - the message to add
      promise - the write promise
      Returns:
      true, if the message could be added, false if the window has no capacity
    • remove

      io.netty.channel.ChannelPromise remove()
      Removes the oldest message from the window.
      Returns:
      the write promise of the oldest message
    • getQueue

      List<Window.Frame> getQueue()
      Returns:
      the original unacknowledged message queue
    • size

      int size()
      Returns:
      the size of the window
    • getFreeSpace

      int getFreeSpace()
      Returns:
      the free space of the window
    • removeAndFailAll

      void removeAndFailAll(Throwable cause)
      Clears the window and let's fail all write promises.
      Parameters:
      cause - the cause of the failure