Class AFSocketPair<T extends AFSomeSocket>

java.lang.Object
org.newsclub.net.unix.CloseablePair<T>
org.newsclub.net.unix.AFSocketPair<T>
Type Parameters:
T - The socket type.
All Implemented Interfaces:
Closeable, AutoCloseable
Direct Known Subclasses:
AFUNIXSocketPair

public abstract class AFSocketPair<T extends AFSomeSocket> extends CloseablePair<T>
A pair of sockets.
Author:
Christian Kohlschütter
  • Constructor Details

    • AFSocketPair

      protected AFSocketPair(T a, T b)
      Creates a socket pair.
      Parameters:
      a - The first socket.
      b - The second socket.
    • AFSocketPair

      protected AFSocketPair(T a, T b, Closeable alsoClose)
      Creates a socket pair.
      Parameters:
      a - The first socket.
      b - The second socket.
      alsoClose - Some closeable that is also closed upon CloseablePair.close(), or null.
  • Method Details

    • getSocket1

      public final @NonNull T getSocket1()
      Returns the first socket of the pair.
      Returns:
      The first socket.
    • getSocket2

      public final @NonNull T getSocket2()
      Returns the second socket of the pair.
      Returns:
      The second socket.