Loading src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java +14 −0 Original line number Diff line number Diff line Loading @@ -587,6 +587,20 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession { } readLength = a.read(buffer, 0, outputBufferSize); while (true) { int congStatus = ((BluetoothOppTransport)mTransport1).getSockCongStatus(); if ((congStatus == 0) || (congStatus == -1)) { break; } try { Thread.sleep(5); } catch (InterruptedException slpe) { Log.v(TAG, "Interrupted while checking the socket congestion evt"); break; } } int writtenLength = 0; while (writtenLength != readLength) { //SET MTU SIZE BEFORE WRITE Loading src/com/android/bluetooth/opp/BluetoothOppTransport.java +15 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,21 @@ public class BluetoothOppTransport implements ObexTransport { return status; } /** * Returns the Congestion status of the Socket */ public int getSockCongStatus() { ByteBuffer bb = ByteBuffer.allocate(4); bb.order(ByteOrder.LITTLE_ENDIAN); int status; try { status = mSocket.getSocketOpt(5, bb.array()); } catch (IOException ex) { return -1; } return bb.getInt(); } public void connect() throws IOException { } Loading Loading
src/com/android/bluetooth/opp/BluetoothOppObexClientSession.java +14 −0 Original line number Diff line number Diff line Loading @@ -587,6 +587,20 @@ public class BluetoothOppObexClientSession implements BluetoothOppObexSession { } readLength = a.read(buffer, 0, outputBufferSize); while (true) { int congStatus = ((BluetoothOppTransport)mTransport1).getSockCongStatus(); if ((congStatus == 0) || (congStatus == -1)) { break; } try { Thread.sleep(5); } catch (InterruptedException slpe) { Log.v(TAG, "Interrupted while checking the socket congestion evt"); break; } } int writtenLength = 0; while (writtenLength != readLength) { //SET MTU SIZE BEFORE WRITE Loading
src/com/android/bluetooth/opp/BluetoothOppTransport.java +15 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,21 @@ public class BluetoothOppTransport implements ObexTransport { return status; } /** * Returns the Congestion status of the Socket */ public int getSockCongStatus() { ByteBuffer bb = ByteBuffer.allocate(4); bb.order(ByteOrder.LITTLE_ENDIAN); int status; try { status = mSocket.getSocketOpt(5, bb.array()); } catch (IOException ex) { return -1; } return bb.getInt(); } public void connect() throws IOException { } Loading