summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2019-05-30 11:05:43 -0400
committerNicoleYarroch <nicole@livio.io>2019-05-30 11:05:43 -0400
commit3779a2ba32cc38ed047341eb15393b86a5b2787a (patch)
tree5dc4359166e1de816a4d4eca687ed27cb25c9071
parent6950fd9c8c8179f5b06f81ef11e2f4b37dd829f0 (diff)
downloadsdl_ios-3779a2ba32cc38ed047341eb15393b86a5b2787a.tar.gz
Added SDL log for debugging output stream writes
-rw-r--r--SmartDeviceLink/SDLIAPDataSession.m8
1 files changed, 6 insertions, 2 deletions
diff --git a/SmartDeviceLink/SDLIAPDataSession.m b/SmartDeviceLink/SDLIAPDataSession.m
index 138700591..16a6bdbff 100644
--- a/SmartDeviceLink/SDLIAPDataSession.m
+++ b/SmartDeviceLink/SDLIAPDataSession.m
@@ -146,6 +146,8 @@ NS_ASSUME_NONNULL_BEGIN
#pragma mark - Sending data
- (void)sendData:(NSData *)data {
+ SDLLogV(@"Sending data %lu. I/O streams open? %s", (unsigned long)data.length, self.isStopped ? "no" : "yes");
+
// Enqueue the data for transmission on the IO thread
[self.sendDataQueue enqueueBuffer:data.mutableCopy];
@@ -173,10 +175,11 @@ NS_ASSUME_NONNULL_BEGIN
return;
}
- SDLLogV(@"Writing to the data session's output stream");
-
NSUInteger bytesRemaining = remainder.length;
NSInteger bytesWritten = [ostream write:remainder.bytes maxLength:bytesRemaining];
+
+ SDLLogV(@"%ld bytes written to data session output stream", (long)bytesWritten);
+
if (bytesWritten < 0) {
if (ostream.streamError != nil) {
[self sdl_handleOutputStreamWriteError:ostream.streamError];
@@ -321,6 +324,7 @@ NS_ASSUME_NONNULL_BEGIN
* Called when the session gets a `NSStreamEventHasSpaceAvailable` event code. Send any queued data to Core.
*/
- (void)sdl_streamHasSpaceToWrite {
+ SDLLogV(@"NSStreamEventHasSpaceAvailable");
[self sdl_dequeueAndWriteToOutputStream];
}