File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
main/java/com/timgroup/statsd
test/java/com/timgroup/statsd Expand file tree Collapse file tree 2 files changed +6
-6
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 ;
14+ private volatile boolean serverRunning = true ;
1515
1616 public UnixDatagramSocketDummyStatsDServer (String socketPath ) throws IOException {
1717 if (ClientChannelUtils .hasNativeUdsSupport ()) {
@@ -35,7 +35,7 @@ public UnixDatagramSocketDummyStatsDServer(String socketPath) throws IOException
3535
3636 @ Override
3737 protected boolean isOpen () {
38- return running && server .isOpen ();
38+ return serverRunning && server .isOpen ();
3939 }
4040
4141 protected void receive (ByteBuffer packet ) throws IOException {
@@ -44,12 +44,12 @@ protected void receive(ByteBuffer packet) throws IOException {
4444
4545 @ Override
4646 public void close () throws IOException {
47- running = false ; // Signal the listening thread to stop
47+ serverRunning = false ;
4848 try {
4949 // Give the listening thread a chance to stop
50- Thread .sleep (50 );
50+ Thread .sleep (1000 );
5151 } catch (InterruptedException e ) {
52- // Ignore
52+ // ignore
5353 }
5454 try {
5555 server .close ();
You can’t perform that action at this time.
0 commit comments