Skip to content

Commit 44028e6

Browse files
committed
Remove running var from UnixDatagramSocketDummyStatsDServer
1 parent 08b8627 commit 44028e6

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/test/java/com/timgroup/statsd/UnixDatagramSocketDummyStatsDServer.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
public class UnixDatagramSocketDummyStatsDServer extends DummyStatsDServer {
1313
private final DatagramChannel server;
14-
private volatile boolean running = true;
1514

1615
public UnixDatagramSocketDummyStatsDServer(String socketPath) throws IOException {
1716
if (ClientChannelUtils.hasNativeUdsSupport()) {
@@ -35,22 +34,14 @@ public UnixDatagramSocketDummyStatsDServer(String socketPath) throws IOException
3534

3635
@Override
3736
protected boolean isOpen() {
38-
return running && server.isOpen();
37+
return server.isOpen();
3938
}
4039

4140
protected void receive(ByteBuffer packet) throws IOException {
4241
server.receive(packet);
4342
}
4443

45-
@Override
4644
public void close() throws IOException {
47-
running = false; // Signal the listening thread to stop
48-
try {
49-
// Give the listening thread a chance to stop
50-
Thread.sleep(50);
51-
} catch (InterruptedException e) {
52-
// Ignore
53-
}
5445
try {
5546
server.close();
5647
} catch (Exception e) {

0 commit comments

Comments
 (0)