File tree 1 file changed +5
-2
lines changed
src/main/java/de/javasocketapi/core
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 3
3
import java .io .IOException ;
4
4
import java .net .ServerSocket ;
5
5
import java .net .Socket ;
6
- import java .util .LinkedList ;
6
+ import java .util .ArrayList ;
7
+ import java .util .List ;
7
8
import java .util .UUID ;
8
9
9
10
class ServerSocketAcceptingThread extends Thread {
10
11
11
12
private final ServerSocket serverSocket ;
12
- private final LinkedList <Client > clients = new LinkedList <>();
13
+ private final List <Client > clients = new ArrayList <>();
13
14
14
15
public ServerSocketAcceptingThread (final ServerSocket serverSocket ) {
15
16
this .serverSocket = serverSocket ;
@@ -52,6 +53,7 @@ public void disconnectClient(final UUID uuid) {
52
53
//disconnect client
53
54
this .clients .stream ().filter (client -> client .getConnectionUUID ().get ().equals (uuid )).forEach (client -> {
54
55
try {
56
+ System .out .println ("[SocketAPI] Client: " + client .getConnectionUUID ().get () + " will be disconnected!" );
55
57
client .disconnect ();
56
58
} catch (IOException exception ) {
57
59
exception .printStackTrace ();
@@ -61,6 +63,7 @@ public void disconnectClient(final UUID uuid) {
61
63
62
64
public void disconnectAllClients () {
63
65
//disconnect all clients
66
+ System .out .println ("[SocketAPI] All Clients will be disconnected!" );
64
67
this .clients .forEach (client -> {
65
68
try {
66
69
if (client != null ){
You can’t perform that action at this time.
0 commit comments