Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25533

Android: Allow HTTPClient to send request in onload

    Details

    • Story Points:
      3
    • Sprint:
      2018 Sprint 06 SDK, 2018 Sprint 07 SDK, 2018 Sprint 08 SDK, 2018 Sprint 09 SDK, 2018 Sprint 10 SDK, 2018 Sprint 11 SDK, 2018 Sprint 12 SDK, 2018 Sprint 13 SDK, 2018 Sprint 14 SDK, 2018 Sprint 15 SDK, 2018 Sprint 16 SDK, 2016 Sprint 17 SDK, 2018 Sprint 18 SDK, 2018 Sprint 19 SDK, 2018 Sprint 20 SDK, 2018 Sprint 21, 2018 Sprint 22

      Description

      I got an app that send post json objects synchronous via recursive function,
      Once an object is sent I wait for the response before sending another, but Im getting timedout errors:

      [INFO]  to server: {"params":{"venta":{"ven_fecha":"2017-10-29 19:15:57","ven_usuario":7,"ven_cliente":279,"ven_salida":71,"ven_ruta":1,"ven_localidad":1,"ven_total":316,"ven_pagado":316,"ven_factura":0,"ven_tipo":1,"ven_estatus":0,"apa_monto":0,"ven_descuento":"","Detalles":[{"vpr_venta":3,"vpr_salida":71,"vpr_producto":77,"vpr_precio_oficial":121,"vpr_precio_venta":121,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":121,"vpr_descripcion":"BONAFONT 24/600ML","vpr_costo":82.42},{"vpr_venta":3,"vpr_salida":71,"vpr_producto":79,"vpr_precio_oficial":88,"vpr_precio_venta":88,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":88,"vpr_descripcion":"BONAFONT 12/1LT","vpr_costo":59.04},{"vpr_venta":3,"vpr_salida":71,"vpr_producto":80,"vpr_precio_oficial":107,"vpr_precio_venta":107,"vpr_IVA":0,"vpr_hectolitros":0,"vpr_cantidad":1,"vpr_devolucion":0,"vpr_estatus":0,"vpr_importe":107,"vpr_descripcion":"BONAFONT 12/1.5 LTS","vpr_costo":71.96}]},"usuario":"marcelo","clave":"m1"},"metodo":"subirVentas","url":"http://bebimex.com/sw/servidor/mobil.php"}
      [INFO]  art: Background partial concurrent mark sweep GC freed 115194(6MB) AllocSpace objects, 67(1340KB) LOS objects, 40%% free, 14MB/23MB, paused 563us total 109.330ms
      [ERROR] TiHTTPClient: (TiHttpClient-7) [11182,220758] HTTP Error (java.net.SocketTimeoutException): timeout
      [ERROR] TiHTTPClient: java.net.SocketTimeoutException: timeout
      [ERROR] TiHTTPClient:   at com.android.okhttp.okio.Okio$3.newTimeoutException(Okio.java:212)
      [ERROR] TiHTTPClient:   at com.android.okhttp.okio.AsyncTimeout.exit(AsyncTimeout.java:261)
      [ERROR] TiHTTPClient:   at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:215)
      [ERROR] TiHTTPClient:   at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:306)
      [ERROR] TiHTTPClient:   at com.android.okhttp.okio.RealBufferedSource.indexOf(RealBufferedSource.java:300)
      [ERROR] TiHTTPClient:   at com.android.okhttp.okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:196)
      [ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpConnection.readResponse(HttpConnection.java:191)
      [ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:80)
      [ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpEngine.readNetworkResponse(HttpEngine.java:907)
      [ERROR] TiHTTPClient:   at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:783)
      [ERROR] TiHTTPClient:   at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:463)
      [ERROR] TiHTTPClient:   at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:405)
      [ERROR] TiHTTPClient:   at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:521)
      [ERROR] TiHTTPClient:   at ti.modules.titanium.network.TiHTTPClient$ClientRunnable.run(TiHTTPClient.java:1224)
      [ERROR] TiHTTPClient:   at java.lang.Thread.run(Thread.java:761)
      [ERROR] TiHTTPClient: Caused by: java.net.SocketException: Socket operation on non-socket
      [ERROR] TiHTTPClient:   at java.net.SocketInputStream.socketRead0(Native Method)
      [ERROR] TiHTTPClient:   at java.net.SocketInputStream.read(SocketInputStream.java:151)
      [ERROR] TiHTTPClient:   at java.net.SocketInputStream.read(SocketInputStream.java:120)
      [ERROR] TiHTTPClient:   at com.android.okhttp.okio.Okio$2.read(Okio.java:136)
      [ERROR] TiHTTPClient:   at com.android.okhttp.okio.AsyncTimeout$2.read(AsyncTimeout.java:211)
      [ERROR] TiHTTPClient:   ... 12 more
      [INFO]  status 0
       
      
      

        Attachments

          Activity

            People

            • Assignee:
              gmathews Gary Mathews
              Reporter:
              knd_rt@hotmail.com knd_rt@hotmail.com
              Reviewer:
              Yordan Banev
            • Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code