Added support for 'wait' flag in sendMessage:data:wait:.

git-svn-id: http://macvim.googlecode.com/svn/trunk@24 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
Bjorn Winckler
2007-07-29 10:24:42 +00:00
parent 0fd41065f9
commit a1011f566a
+13 -2
View File
@@ -160,8 +160,19 @@ static NSMenuItem *findMenuItemWithTagInMenu(NSMenu *root, int tag)
- (void)sendMessage:(int)msgid data:(NSData *)data wait:(BOOL)wait
{
#if MM_USE_DO
// TODO: Decrease reply/request timeouts if 'wait' is off.
[backendProxy processInput:msgid data:data];
if (wait) {
[backendProxy processInput:msgid data:data];
} else {
// Do not wait for the message to be sent, i.e. drop the message if it
// can't be delivered immediately.
NSConnection *connection = [backendProxy connectionForProxy];
if (connection) {
NSTimeInterval req = [connection requestTimeout];
[connection setRequestTimeout:0];
[backendProxy processInput:msgid data:data];
[connection setRequestTimeout:req];
}
}
#else
[NSPortMessage sendMessage:msgid withSendPort:sendPort data:data
wait:wait];