From 4501542afd27e2346a7be6f54b79d789e842385b Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 16 Jun 2013 01:19:46 -0400 Subject: [PATCH] Update the comments in NetworkCallbackController::WriteString --- Source/NetworkCallbackController.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/NetworkCallbackController.mm b/Source/NetworkCallbackController.mm index 0010824..bbe5cbd 100644 --- a/Source/NetworkCallbackController.mm +++ b/Source/NetworkCallbackController.mm @@ -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_); -- 2.22.5