|
@@ -101,19 +101,24 @@
|
|
|
receivePort:nil
|
|
receivePort:nil
|
|
|
components:components];
|
|
components:components];
|
|
|
message.msgid = msgId;
|
|
message.msgid = msgId;
|
|
|
- if (![message
|
|
|
|
|
|
|
+ if (![port isValid] ||
|
|
|
|
|
+ ![message
|
|
|
sendBeforeDate:
|
|
sendBeforeDate:
|
|
|
[NSDate dateWithTimeIntervalSinceNow:
|
|
[NSDate dateWithTimeIntervalSinceNow:
|
|
|
1.0]]) {
|
|
1.0]]) {
|
|
|
blog(LOG_DEBUG,
|
|
blog(LOG_DEBUG,
|
|
|
"failed to send message to %d, removing it from the clients!",
|
|
"failed to send message to %d, removing it from the clients!",
|
|
|
((NSMachPort *)port).machPort);
|
|
((NSMachPort *)port).machPort);
|
|
|
|
|
+
|
|
|
|
|
+ [port invalidate];
|
|
|
[removedPorts addObject:port];
|
|
[removedPorts addObject:port];
|
|
|
}
|
|
}
|
|
|
} @catch (NSException *exception) {
|
|
} @catch (NSException *exception) {
|
|
|
blog(LOG_DEBUG,
|
|
blog(LOG_DEBUG,
|
|
|
"failed to send message (exception) to %d, removing it from the clients!",
|
|
"failed to send message (exception) to %d, removing it from the clients!",
|
|
|
((NSMachPort *)port).machPort);
|
|
((NSMachPort *)port).machPort);
|
|
|
|
|
+
|
|
|
|
|
+ [port invalidate];
|
|
|
[removedPorts addObject:port];
|
|
[removedPorts addObject:port];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|