remove logging from pingpong
This commit is contained in:
@@ -95,8 +95,6 @@
|
|||||||
|
|
||||||
// Send the pong frame directly through the socket
|
// Send the pong frame directly through the socket
|
||||||
[asyncSocket writeData:pongFrame withTimeout:TIMEOUT_NONE tag:TAG_PONG_SENT];
|
[asyncSocket writeData:pongFrame withTimeout:TIMEOUT_NONE tag:TAG_PONG_SENT];
|
||||||
|
|
||||||
NSLog(@"Sent pong frame with payload length: %lu", (unsigned long)[payload length]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Override AsyncSocket Delegate
|
#pragma mark - Override AsyncSocket Delegate
|
||||||
@@ -107,8 +105,6 @@
|
|||||||
BOOL nextFrameMasked = [[self valueForKey:@"nextFrameMasked"] boolValue];
|
BOOL nextFrameMasked = [[self valueForKey:@"nextFrameMasked"] boolValue];
|
||||||
NSUInteger nextOpCode = [[self valueForKey:@"nextOpCode"] unsignedIntValue];
|
NSUInteger nextOpCode = [[self valueForKey:@"nextOpCode"] unsignedIntValue];
|
||||||
|
|
||||||
NSLog(@"tag: %ld, nextOpCode: %lu", tag, (unsigned long)nextOpCode);
|
|
||||||
|
|
||||||
// Handle our custom ping payload tag
|
// Handle our custom ping payload tag
|
||||||
if (tag == TAG_PING_PAYLOAD) {
|
if (tag == TAG_PING_PAYLOAD) {
|
||||||
// We've read the ping payload, now send the pong response
|
// We've read the ping payload, now send the pong response
|
||||||
@@ -126,7 +122,6 @@
|
|||||||
payload = [unmaskedPayload copy];
|
payload = [unmaskedPayload copy];
|
||||||
}
|
}
|
||||||
|
|
||||||
NSLog(@"Sending pong response to ping with payload length: %lu", (unsigned long)[payload length]);
|
|
||||||
[self sendPongWithPayload:payload];
|
[self sendPongWithPayload:payload];
|
||||||
|
|
||||||
// Continue reading the next frame
|
// Continue reading the next frame
|
||||||
@@ -149,8 +144,6 @@
|
|||||||
nextFrameMasked = masked;
|
nextFrameMasked = masked;
|
||||||
currentPayloadLength = length;
|
currentPayloadLength = length;
|
||||||
|
|
||||||
NSLog(@"Processing ping/pong frame, masked: %d, length: %lu", masked, (unsigned long)length);
|
|
||||||
|
|
||||||
if (length <= 125) {
|
if (length <= 125) {
|
||||||
if (nextFrameMasked) {
|
if (nextFrameMasked) {
|
||||||
[asyncSocket readDataToLength:4 withTimeout:TIMEOUT_NONE tag:TAG_MSG_MASKING_KEY];
|
[asyncSocket readDataToLength:4 withTimeout:TIMEOUT_NONE tag:TAG_MSG_MASKING_KEY];
|
||||||
@@ -158,7 +151,6 @@
|
|||||||
[asyncSocket readDataToLength:length withTimeout:TIMEOUT_NONE tag:TAG_PING_PAYLOAD];
|
[asyncSocket readDataToLength:length withTimeout:TIMEOUT_NONE tag:TAG_PING_PAYLOAD];
|
||||||
} else {
|
} else {
|
||||||
// Empty payload, no masking - handle immediately
|
// Empty payload, no masking - handle immediately
|
||||||
NSLog(@"Handling empty unmasked ping payload");
|
|
||||||
[self sendPongWithPayload:[NSData data]];
|
[self sendPongWithPayload:[NSData data]];
|
||||||
[asyncSocket readDataToLength:1 withTimeout:TIMEOUT_NONE tag:TAG_PAYLOAD_PREFIX];
|
[asyncSocket readDataToLength:1 withTimeout:TIMEOUT_NONE tag:TAG_PAYLOAD_PREFIX];
|
||||||
}
|
}
|
||||||
@@ -175,14 +167,12 @@
|
|||||||
if (tag == TAG_MSG_MASKING_KEY) {
|
if (tag == TAG_MSG_MASKING_KEY) {
|
||||||
// Store the masking key
|
// Store the masking key
|
||||||
maskingKey = [data copy];
|
maskingKey = [data copy];
|
||||||
NSLog(@"Stored masking key for ping/pong frame");
|
|
||||||
|
|
||||||
// Now read the payload (or handle empty payload)
|
// Now read the payload (or handle empty payload)
|
||||||
if (currentPayloadLength > 0) {
|
if (currentPayloadLength > 0) {
|
||||||
[asyncSocket readDataToLength:currentPayloadLength withTimeout:TIMEOUT_NONE tag:TAG_PING_PAYLOAD];
|
[asyncSocket readDataToLength:currentPayloadLength withTimeout:TIMEOUT_NONE tag:TAG_PING_PAYLOAD];
|
||||||
} else {
|
} else {
|
||||||
// Empty payload - send pong immediately
|
// Empty payload - send pong immediately
|
||||||
NSLog(@"Sending pong for empty masked ping payload");
|
|
||||||
[self sendPongWithPayload:[NSData data]];
|
[self sendPongWithPayload:[NSData data]];
|
||||||
[asyncSocket readDataToLength:1 withTimeout:TIMEOUT_NONE tag:TAG_PAYLOAD_PREFIX];
|
[asyncSocket readDataToLength:1 withTimeout:TIMEOUT_NONE tag:TAG_PAYLOAD_PREFIX];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user