101 Network error

We met a 101 network error when we send a post request to server on IOS 10. But, it works on IOS9 before.


From JS side, we use XMLHttpRequest to open an URL synchronized and then send the data to server. See following code:

var xmlhttp = hwc.getXMLHTTPRequest();

xmlhttp.open("POST", url, false);

try

{

xmlhttp.send(data);

}

catch (ex)

{

if (ex.message.search(/XMLHttpRequest Exception 101/) === -1)

{

throw ex;

}

}


The above code can works well on IOS9 and previous version. But, it can't works on IOS10 for my case. Also, I found the to open the xmlhttprequest object asychronized can works well. I am not sure if this is an issue on IOS 10 webkit. And, during the error was occurred, I found some logs were printed on XCode console:

2016-09-16 16:44:36.922790 HWC[11048:162611] [] __nwlog_err_simulate_crash simulate crash already simulated "nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available"

2016-09-16 16:44:36.922999 HWC[11048:162611] [] nw_socket_set_common_sockopts setsockopt SO_NOAPNFALLBK failed: [42] Protocol not available, dumping backtrace:

[x86_64] libnetcore-856.1.8

0 libsystem_network.dylib 0x00000001163be80e __nw_create_backtrace_string + 123

1 libnetwork.dylib 0x00000001165d7194 nw_socket_add_input_handler + 3002

2 libnetwork.dylib 0x00000001165b4db8 nw_endpoint_flow_attach_protocols + 3768

3 libnetwork.dylib 0x00000001165b3dd5 nw_endpoint_flow_setup_socket + 563

4 libnetwork.dylib 0x00000001165b2b34 -[NWConcrete_nw_endpoint_flow startWithHandler:] + 2612

5 libnetwork.dylib 0x00000001165cdd11 nw_endpoint_handler_path_change + 1261

6 libnetwork.dylib 0x00000001165cd740 nw_endpoint_handler_start + 570

7 libnetwork.dylib 0x00000001165e5003 nw_endpoint_resolver_start_next_child + 2240

8 libdispatch.dylib 0x000000


Can anyone give me some suggestion about this?THanks!