Our OSX app is uploading multiple files to the server using
func uploadTask(withStreamedRequest request: URLRequest) -> URLSessionUploadTask
While uploading, the upload gets stuck. Some files manage to upload successfully, sometimes more files other times less.
Looking at the debug navigator I can see that my stream thread shows two calls (one after the other; frame 11 and frame 5) to stream:handleEvent
delegate, that points me to the code line where i call write:maxLength on NSOutputStrem
, following __psynch_mutexwait
in frame 0. At this point app is stuck and no network calls can finish executing.
Did anyone come across this issue? Any help is appreciated, thanks.
It looks like your handler is being signaled twice to write to the same stream. Add a check that the streamStatus is NSStreamStatusWriting and return early.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.