Package com.neovisionaries.ws.client
Class SocketInitiator.SocketFuture
java.lang.Object
com.neovisionaries.ws.client.SocketInitiator.SocketFuture
- Enclosing class:
SocketInitiator
The socket future is shared across all
SocketInitiator.SocketRacer
threads 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
FieldsModifier and TypeFieldDescriptionprivate Exception
private CountDownLatch
private List
<SocketInitiator.SocketRacer> private Socket
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) Socket
await
(List<SocketInitiator.SocketRacer> racers) (package private) boolean
(package private) void
setException
(Exception exception) (package private) void
setSocket
(SocketInitiator.SocketRacer current, Socket socket)
-
Field Details
-
mLatch
-
mRacers
-
mSocket
-
mException
-
-
Constructor Details
-
SocketFuture
private SocketFuture()
-
-
Method Details
-
hasSocket
boolean hasSocket() -
setSocket
-
setException
-
await
- Throws:
Exception
-