network.request() and timeouts?

In the call to network.request() I can specify a timeout parameter and it is described as “Timeout in seconds. Default is 30 seconds.” in the network request documentation (https://docs.coronalabs.com/api/library/network/request.html)

What does this mean in more detail? Is it a send, receive and/or a connect timeout?

If a server is not started at all the network.request() returns immediately. This is expected but if the server is running but refuses to read incoming bytes (after a successful connect) the network.request() call fails after ~40 seconds with the event:

table: 0x600000871700 {
                      [responseType] => “text”
                      [phase] => “ended”
                      [bytesEstimated] => 0
                      [response] => “The request timed out.”
                      [name] => “networkRequest”
                      [bytesTransferred] => 0
                      [status] => -1
                      [url] => "http://www.scruple.net:5001/jsonrpc"
                      [isError] => true
                      [requestId] => userdata: 0x60000024f898
                    }

This happens even though the timeout is set to an hour.

What is the timeout parameter supposed to do?

Cheers

/Joakim

Gah! My bad. The timeout problem was my fault and I suppose that the timeout is applied by the network module on both read, write and connect timeouts on the underlying socket.

Thanks

/Joakim

Gah! My bad. The timeout problem was my fault and I suppose that the timeout is applied by the network module on both read, write and connect timeouts on the underlying socket.

Thanks

/Joakim