Package it.polimi.ingsw.Server
Class SocketKeepAlive
java.lang.Object
it.polimi.ingsw.Server.SocketKeepAlive
Application-level KeepAlive implementation
-
Field Summary
Modifier and TypeFieldDescriptionprivate CountDownLatch
private final int
(package private) ScheduledExecutorService
private final AtomicBoolean
private final int
private final Socket
-
Constructor Summary
ConstructorDescriptionSocketKeepAlive
(Socket socket, GameController gc) Naive Application-level KeepAlive implementation -
Method Summary
-
Field Details
-
CDL_TIMEOUT
private final int CDL_TIMEOUT- See Also:
-
SEC_TIMEOUT
private final int SEC_TIMEOUT- See Also:
-
flag
-
socket
-
executor
ScheduledExecutorService executor -
cdl
-
-
Constructor Details
-
SocketKeepAlive
Naive Application-level KeepAlive implementation- Parameters:
socket
- attached to the clientgc
- related to the client
-
-
Method Details
-
received
public void received()Sets the KeepAlive as received (setting the correspondent flag), the next scheduled task to run will get the flag as valid and reset the CDL -
closed
public boolean closed()- Returns:
- status of the Client's socket
-