Skip to content

Commit d4b7997

Browse files
committed
Improved logging
1 parent 3fce6ef commit d4b7997

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

GCD/GCDAsyncUdpSocket.m

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,9 @@ - (BOOL)bindToPort:(uint16_t)port interface:(NSString *)interface error:(NSError
27572757
else
27582758
dispatch_sync(socketQueue, block);
27592759

2760+
if (err)
2761+
LogError(@"Error binding to port/interface: %@", err);
2762+
27602763
if (errPtr)
27612764
*errPtr = [err autorelease];
27622765
else
@@ -2883,6 +2886,9 @@ - (BOOL)bindToAddress:(NSData *)localAddr error:(NSError **)errPtr
28832886
else
28842887
dispatch_sync(socketQueue, block);
28852888

2889+
if (err)
2890+
LogError(@"Error binding to address: %@", err);
2891+
28862892
if (errPtr)
28872893
*errPtr = [err autorelease];
28882894
else
@@ -3006,6 +3012,9 @@ - (BOOL)connectToHost:(NSString *)host onPort:(uint16_t)port error:(NSError **)e
30063012
else
30073013
dispatch_sync(socketQueue, block);
30083014

3015+
if (err)
3016+
LogError(@"Error connecting to host/port: %@", err);
3017+
30093018
if (errPtr)
30103019
*errPtr = [err autorelease];
30113020
else
@@ -3074,6 +3083,9 @@ - (BOOL)connectToAddress:(NSData *)remoteAddr error:(NSError **)errPtr
30743083
else
30753084
dispatch_sync(socketQueue, block);
30763085

3086+
if (err)
3087+
LogError(@"Error connecting to address: %@", err);
3088+
30773089
if (errPtr)
30783090
*errPtr = [err autorelease];
30793091
else
@@ -3833,6 +3845,9 @@ - (BOOL)beginReceiving:(NSError **)errPtr
38333845
else
38343846
dispatch_sync(socketQueue, block);
38353847

3848+
if (err)
3849+
LogError(@"Error in beginReceiving: %@", err);
3850+
38363851
if (errPtr)
38373852
*errPtr = [err autorelease];
38383853
else

0 commit comments

Comments
 (0)