Package com.neovisionaries.ws.client
Class SocketInitiator.SocketFuture
- java.lang.Object
-
- com.neovisionaries.ws.client.SocketInitiator.SocketFuture
-
- Enclosing class:
- SocketInitiator
private class SocketInitiator.SocketFuture extends java.lang.ObjectThe socket future is shared across allSocketInitiator.SocketRacerthreads and aggregates the results. A socket future is considered fulfilled when...- any racer thread has established a socket in which case all other racers will be stopped, or
- all racer threads returned with an exception, or
- there was no racer thread (e.g. in case there is no network interface).
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ExceptionmExceptionprivate java.util.concurrent.CountDownLatchmLatchprivate java.util.List<SocketInitiator.SocketRacer>mRacersprivate java.net.SocketmSocket
-
Constructor Summary
Constructors Modifier Constructor Description privateSocketFuture()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.net.Socketawait(java.util.List<SocketInitiator.SocketRacer> racers)(package private) booleanhasSocket()(package private) voidsetException(java.lang.Exception exception)(package private) voidsetSocket(SocketInitiator.SocketRacer current, java.net.Socket socket)
-
-
-
Field Detail
-
mLatch
private java.util.concurrent.CountDownLatch mLatch
-
mRacers
private java.util.List<SocketInitiator.SocketRacer> mRacers
-
mSocket
private java.net.Socket mSocket
-
mException
private java.lang.Exception mException
-
-
Method Detail
-
hasSocket
boolean hasSocket()
-
setSocket
void setSocket(SocketInitiator.SocketRacer current, java.net.Socket socket)
-
setException
void setException(java.lang.Exception exception)
-
await
java.net.Socket await(java.util.List<SocketInitiator.SocketRacer> racers) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-