This commit is contained in:
Eric House 2018-12-12 22:21:02 -08:00
parent c2f5949623
commit 61dc8e837e

View file

@ -760,14 +760,7 @@ public class BTService extends XWService {
} }
} }
if ( null != m_serverSocket ) { closeServerSocket();
try {
m_serverSocket.close();
} catch ( IOException ioe ) {
logIOE( ioe );
}
m_serverSocket = null;
}
} // run() } // run()
private static class InPacket { private static class InPacket {
@ -840,6 +833,12 @@ public class BTService extends XWService {
} }
public void stopListening() public void stopListening()
{
closeServerSocket();
interrupt();
}
private synchronized void closeServerSocket()
{ {
if ( null != m_serverSocket ) { if ( null != m_serverSocket ) {
try { try {
@ -849,7 +848,6 @@ public class BTService extends XWService {
} }
m_serverSocket = null; m_serverSocket = null;
} }
interrupt();
} }
private boolean protoOK( byte proto, BTCmd cmd ) private boolean protoOK( byte proto, BTCmd cmd )