File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/main/java/de/javasocketapi/core Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 33import java .io .IOException ;
44import java .net .ServerSocket ;
55import java .net .Socket ;
6- import java .util .LinkedList ;
6+ import java .util .ArrayList ;
7+ import java .util .List ;
78import java .util .UUID ;
89
910class ServerSocketAcceptingThread extends Thread {
1011
1112 private final ServerSocket serverSocket ;
12- private final LinkedList <Client > clients = new LinkedList <>();
13+ private final List <Client > clients = new ArrayList <>();
1314
1415 public ServerSocketAcceptingThread (final ServerSocket serverSocket ) {
1516 this .serverSocket = serverSocket ;
@@ -52,6 +53,7 @@ public void disconnectClient(final UUID uuid) {
5253 //disconnect client
5354 this .clients .stream ().filter (client -> client .getConnectionUUID ().get ().equals (uuid )).forEach (client -> {
5455 try {
56+ System .out .println ("[SocketAPI] Client: " + client .getConnectionUUID ().get () + " will be disconnected!" );
5557 client .disconnect ();
5658 } catch (IOException exception ) {
5759 exception .printStackTrace ();
@@ -61,6 +63,7 @@ public void disconnectClient(final UUID uuid) {
6163
6264 public void disconnectAllClients () {
6365 //disconnect all clients
66+ System .out .println ("[SocketAPI] All Clients will be disconnected!" );
6467 this .clients .forEach (client -> {
6568 try {
6669 if (client != null ){
You can’t perform that action at this time.
0 commit comments