From 4d52d28e06144b69bc16037040ed3974bb4266d6 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Thu, 25 Aug 2016 09:56:12 -0400 Subject: [PATCH] Use non-deprecated method for sending data. No copying required in our case since we've just built the data for only this purpose. // FREEBIE --- src/Network/WebSockets/TSSocketManager.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Network/WebSockets/TSSocketManager.m b/src/Network/WebSockets/TSSocketManager.m index bf8845c3a..bc62759a2 100644 --- a/src/Network/WebSockets/TSSocketManager.m +++ b/src/Network/WebSockets/TSSocketManager.m @@ -205,10 +205,10 @@ NSString *const SocketConnectingNotification = @"SocketConnectingNotification"; [message setResponse:response.build]; [message setType:WebSocketMessageTypeResponse]; - @try { - [self.websocket send:message.build.data]; - } @catch (NSException *exception) { - DDLogWarn(@"Caught exception while trying to write on the socket %@", exception.debugDescription); + NSError *error; + [self.websocket sendDataNoCopy:message.build.data error:&error]; + if (error) { + DDLogWarn(@"Error while trying to write on websocket %@", error); } }