mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +01:00
send result (failure) for SEND even if there's an exception
This commit is contained in:
parent
ab32480cd5
commit
b3fdcecaf4
1 changed files with 7 additions and 5 deletions
|
@ -387,6 +387,7 @@ public class BTService extends Service {
|
||||||
|
|
||||||
private void sendMsg( BTQueueElem elem )
|
private void sendMsg( BTQueueElem elem )
|
||||||
{
|
{
|
||||||
|
boolean success = false;
|
||||||
try {
|
try {
|
||||||
BluetoothDevice dev = m_adapter.getRemoteDevice( elem.m_addr );
|
BluetoothDevice dev = m_adapter.getRemoteDevice( elem.m_addr );
|
||||||
BluetoothSocket socket =
|
BluetoothSocket socket =
|
||||||
|
@ -406,17 +407,18 @@ public class BTService extends Service {
|
||||||
|
|
||||||
DataInputStream inStream =
|
DataInputStream inStream =
|
||||||
new DataInputStream( socket.getInputStream() );
|
new DataInputStream( socket.getInputStream() );
|
||||||
boolean success =
|
success =
|
||||||
BTCmd.MESG_ACCPT == BTCmd.values()[inStream.readByte()];
|
BTCmd.MESG_ACCPT == BTCmd.values()[inStream.readByte()];
|
||||||
socket.close();
|
socket.close();
|
||||||
|
|
||||||
BTEvent evt = success ? BTEvent.MESSAGE_ACCEPTED
|
|
||||||
: BTEvent.MESSAGE_REFUSED;
|
|
||||||
sendResult( evt, elem.m_gameID, 0, elem.m_recipient );
|
|
||||||
}
|
}
|
||||||
} catch ( java.io.IOException ioe ) {
|
} catch ( java.io.IOException ioe ) {
|
||||||
DbgUtils.logf( "sendInvites: ioe: %s", ioe.toString() );
|
DbgUtils.logf( "sendInvites: ioe: %s", ioe.toString() );
|
||||||
|
success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BTEvent evt = success ? BTEvent.MESSAGE_ACCEPTED
|
||||||
|
: BTEvent.MESSAGE_REFUSED;
|
||||||
|
sendResult( evt, elem.m_gameID, 0, elem.m_recipient );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addAddr( BluetoothSocket socket )
|
private void addAddr( BluetoothSocket socket )
|
||||||
|
|
Loading…
Add table
Reference in a new issue