mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-29 08:34:37 +01:00
close socket on thread exit -- allows to reconnect to relay after
closing and reopening a game.
This commit is contained in:
parent
7e20bd1a30
commit
0df6bf873c
1 changed files with 9 additions and 1 deletions
|
@ -67,10 +67,18 @@ public class CommsTransport extends Thread implements TransportProcs {
|
|||
= new InetSocketAddress( m_addr.ip_relay_hostName,
|
||||
m_addr.ip_relay_port );
|
||||
m_socketChannel.connect( isa );
|
||||
|
||||
loop();
|
||||
|
||||
m_socketChannel.close();
|
||||
} catch ( java.io.IOException ioe ) {
|
||||
Utils.logf( ioe.toString() );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void loop()
|
||||
{
|
||||
while ( !m_done ) {
|
||||
try {
|
||||
int ops = figureOps();
|
||||
|
@ -122,7 +130,7 @@ public class CommsTransport extends Thread implements TransportProcs {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} // loop
|
||||
|
||||
private synchronized void putOut( final byte[] buf )
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue