File tree Expand file tree Collapse file tree 2 files changed +2
-11
lines changed
main/java/com/timgroup/statsd
test/java/com/timgroup/statsd Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change 55import jnr .unixsocket .UnixSocketOptions ;
66
77import java .io .IOException ;
8+ import java .lang .reflect .Method ;
89import java .net .SocketAddress ;
910import java .nio .ByteBuffer ;
1011import java .nio .ByteOrder ;
1112import java .nio .channels .SocketChannel ;
12- import java .lang .reflect .Method ;
1313
1414/**
1515 * A ClientChannel for Unix domain sockets.
Original file line number Diff line number Diff line change 1111
1212public 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 ) {
You can’t perform that action at this time.
0 commit comments