Module org.newsclub.net.unix
Package org.newsclub.net.unix
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
A pair of sockets.
- Author:
- Christian Kohlschütter
-
Constructor Summary
ModifierConstructorDescriptionprotected
AFSocketPair
(T a, T b) Creates a socket pair.protected
AFSocketPair
(T a, T b, Closeable alsoClose) Creates a socket pair. -
Method Summary
Methods inherited from class org.newsclub.net.unix.CloseablePair
close, getFirst, getSecond
-
Constructor Details
-
AFSocketPair
-
AFSocketPair
Creates a socket pair.- Parameters:
a
- The first socket.b
- The second socket.alsoClose
- Some closeable that is also closed uponCloseablePair.close()
, ornull
.
-
-
Method Details
-
getSocket1
Returns the first socket of the pair.- Returns:
- The first socket.
-
getSocket2
Returns the second socket of the pair.- Returns:
- The second socket.
-