2

I'm trying to upload videos to a server via TCP/IP using GCDAsyncSocket. Sometimes, the socket disconnects with an error that I haven't been able to eliminate:

2011-12-17 11:39:25.073 Hadza[433:707] socketDidDisconnect, error: Error Domain=NSPOSIXErrorDomain Code=12 "Cannot allocate memory" UserInfo=0x2aa260 {NSLocalizedFailureReason=Error in write() function, NSLocalizedDescription=Cannot allocate memory}

I've been looking everywhere but I can't really see what is the cause of this, how to fix it or workaround this issue.

The flow that the app follows to upload a file is the following:

  1. Write to server (a media_id )
  2. Read an ACK sign from server
  3. Read number of bytes already sent
  4. Write the video from bytes sent to the end
  5. Read waiting for an ACK signal (meaning that the upload was ok)
  6. If everything went OK , finish. If there was an error, restart from 1 or 3 depending on the error.
Goles
  • 11,599
  • 22
  • 79
  • 140
  • Hey there Cristobal, have you checked this other question? http://stackoverflow.com/questions/6072278/nsposixerrordomain-code-12-cannot-allocate-memory-in-3g-network – Goles Dec 18 '11 at 14:44

0 Answers0