I have been trying to implement a multipart form data using Alamofire. I made some code and it works great for requests that performs under 60 seconds. However, if the request takes more than that, it ends and the upload does not finish:
Also, I am getting this output (probably means that my app is trying to write to a closed tcp socket):
2017-06-20 17:22:21.924948 app[4645:1381848] [] nw_endpoint_flow_prepare_output_frames [110.1 10.39.80.102:8550 ready socket-flow (satisfied)] Failed to use 1 frames, marking as failed
2017-06-20 17:22:21.928262 app[4645:1381848] [] nw_endpoint_handler_add_write_request [110.1 10.39.80.102:8550 failed socket-flow (satisfied)] cannot accept write requests
2017-06-20 17:22:21.929278 app[4645:1381027] [] __tcp_connection_write_eof_block_invoke Write close callback received error: [22] Invalid argument
I have already tried to modify the URLSessionConfiguration that I am using to perform the request by changing the timeoutIntervalForRequest and timeoutIntervalForResource parameters:
func initManager(timeoutInterval:Double) {
let configuration = URLSessionConfiguration.default
configuration.timeoutIntervalForRequest = timeoutInterval
configuration.timeoutIntervalForResource = timeoutInterval
alamofireManager = Alamofire.SessionManager(configuration: configuration)
}
However, I still get the same problem. Does anyone know how to solve this? Or does anyone face the same problem?
Thanks
