mirror of
https://github.com/binlaab/nanofiles.git
synced 2026-07-01 19:46:30 +02:00
29 lines
565 B
Java
29 lines
565 B
Java
package es.um.redes.nanoFiles.tcp.server;
|
|
|
|
import java.net.Socket;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
|
|
public class NFServerState {
|
|
private int numberOfConnections;
|
|
private ArrayList<Socket> sockets;
|
|
|
|
public NFServerState() {
|
|
numberOfConnections = 0;
|
|
sockets = new ArrayList<>();
|
|
}
|
|
|
|
public int getNumberOfConnections() {
|
|
return numberOfConnections;
|
|
}
|
|
|
|
public List<Socket> getSockets() {
|
|
return sockets;
|
|
}
|
|
|
|
public void updateState(Socket socket) {
|
|
sockets.add(socket);
|
|
numberOfConnections++;
|
|
}
|
|
}
|