Skip to content

Commit d5c0c60

Browse files
committed
updated ServerSocketAcceptingThread.java
1 parent ab30367 commit d5c0c60

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# JavaSocketAPI
22

3-
## An api for java with the native Java socket technology.
3+
## An api for java with the native Java socket technology and [the java boonproject](https://github.com/boonproject/boon).

src/de/javasocketapi/core/Connection.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
package de.javasocketapi.core;
22

3-
import javafx.beans.property.SimpleObjectProperty;
4-
53
import java.io.IOException;
64
import java.util.UUID;
5+
import java.util.concurrent.atomic.AtomicReference;
76

87
abstract class Connection {
98

10-
private volatile SimpleObjectProperty<UUID> connectionUUID;
9+
private volatile AtomicReference<UUID> connectionUUID;
1110

12-
public SimpleObjectProperty<UUID> getConnectionUUID() {
11+
public AtomicReference<UUID> getConnectionUUID() {
1312
return connectionUUID;
1413
}
1514

1615
{
17-
this.connectionUUID = new SimpleObjectProperty<>(UUID.randomUUID());
16+
this.connectionUUID = new AtomicReference<>(UUID.randomUUID());
1817
}
1918

2019
public abstract void connect() throws IOException;

src/de/javasocketapi/core/ServerSocketAcceptingThread.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public void run() {
4646
public void sendToClient(Packet packet, UUID uuid) {
4747
//send to client
4848
for (Client client : this.clients) {
49-
if (!client.getConnectionUUID().equals(uuid)) {
49+
if (!client.getConnectionUUID().get().equals(uuid)) {
5050
continue;
5151
}
5252
client.send(packet);

0 commit comments

Comments
 (0)