Update the comments in NetworkCallbackController::WriteString
authorRobert Sesek <rsesek@bluestatic.org>
Sun, 16 Jun 2013 05:19:46 +0000 (01:19 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Sun, 16 Jun 2013 05:19:46 +0000 (01:19 -0400)
Source/NetworkCallbackController.mm

index 0010824717c1b6c8350d7d846aa99b6b1092f07b..bbe5cbd2858e3b9301c56d8fcb0aa5f94fa8256e 100644 (file)
@@ -119,11 +119,11 @@ BOOL NetworkCallbackController::WriteString(NSString* string)
   // Include a NUL byte.
   ++bufferSize;
 
-  // Busy wait while writing. BAADD. Should background this operation.
+  // Write the packet out, and spin in a busy wait loop if the stream is not ready. This
+  // method is only ever called in response to a stream ready event.
   NSUInteger totalWritten = 0;
   while (totalWritten < bufferSize) {
     if (WriteStreamCanAcceptBytes()) {
-      // Include the NULL byte in the string when we write.
       CFIndex bytesWritten = CFWriteStreamWrite(writeStream_, buffer + totalWritten, bufferSize - totalWritten);
       if (bytesWritten < 0) {
         CFErrorRef error = CFWriteStreamCopyError(writeStream_);