diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/RelayService.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/RelayService.java index 81df3ba30..9a460ac06 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/RelayService.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/RelayService.java @@ -598,7 +598,6 @@ public class RelayService extends XWJIService } } - sendViaWeb( dataListWeb ); sendViaUDP( dataListUDP ); resetExitTimer(); @@ -664,64 +663,6 @@ public class RelayService extends XWJIService } } - private int sendViaWeb( List packets ) throws InterruptedException - { - int sentLen = 0; - if ( packets.size() > 0 ) { - Log.d( TAG, "sendViaWeb(): sending %d at once", packets.size() ); - - final RelayService service = this; - HttpsURLConnection conn = NetUtils - .makeHttpsRelayConn( service, "post" ); - if ( null == conn ) { - Log.e( TAG, "sendViaWeb(): null conn for POST" ); - } else { - try { - JSONArray dataArray = new JSONArray(); - for ( PacketData packet : packets ) { - Assert.assertFalse( packet == sEOQPacket ); - byte[] datum = packet.assemble(); - dataArray.put( Utils.base64Encode(datum) ); - sentLen += datum.length; - } - JSONObject params = new JSONObject(); - params.put( "data", dataArray ); - - String result = NetUtils.runConn( conn, params ); - boolean succeeded = null != result; - if ( succeeded ) { - Log.d( TAG, "sendViaWeb(): POST(%s) => %s", params, result ); - JSONObject resultObj = new JSONObject( result ); - JSONArray resData = resultObj.getJSONArray( "data" ); - int nReplies = resData.length(); - // Log.d( TAG, "sendViaWeb(): got %d replies", nReplies ); - - service - .noteSent( packets, false ); // before we process the acks below :-) - - for ( int ii = 0; ii < nReplies; ++ii ) { - byte[] datum = Utils.base64Decode( resData.getString( ii ) ); - // PENDING: skip ack or not - service.gotPacket( datum, false, false ); - } - } else { - Log.e( TAG, "sendViaWeb(): failed result for POST" ); - - } - - ConnStatusHandler.updateStatus( service, null, - CommsConnType.COMMS_CONN_RELAY, - succeeded ); - } catch ( JSONException ex ) { - // this will happen if e.g. there's no 'data' in the result - Log.ex( TAG, ex ); - sentLen = 0; - } - } - } - return sentLen; - } - private int sendViaUDP( List packets ) throws InterruptedException { int sentLen = 0;