[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Distributed Objects question...
From: |
PUYDT Julien |
Subject: |
Distributed Objects question... |
Date: |
Tue, 26 Aug 2003 11:39:08 +0200 |
Hi,
I took the client/server example of
http://www.gnustep.it/nicola/Tutorials/DistributedObjects/,
and modified it so that the server returns an (NSImage *) (and modified
the client accordingly, of course):
- (NSImage *)getFile: (NSString *)fileName
{
NSLog(@"GetFile");
NSImage *image;
image = [NSImage alloc];
return [image initWithContentsOfFile: fileName];
}
in my first test, the client just fetched the image and does:
(void)[file size];
with this I got the following message:
2003-08-26 09:15:08.691 client[3684] File GSFFCallInvocation.m: 853. In
GSInvocationCallback Changed type signature '{_NSSize=ff}8@0:4' to
'{_NSSize=ff}12@4:8' for 'size'
in the second test, I tried to display the NSImage in a window with the
following code (the image is in "file"):
NSRect frame = {{0,0}, {300, 300}};
int mode = (NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSResizableWindowMask);
NSWindow *window = [[NSWindow new] initWithContentRect:frame
styleMask: mode
backing: NSBackingStoreRetained
defer: YES];
[window setReleasedWhenClosed:YES];
NSImageView *view = [[NSImageView new] initWithFrame:frame];
[view setImage: file];
[window setFrame:frame display:YES];
[window setMaxSize:frame.size];
[window setContentView:view];
[window center];
[window orderFrontRegardless];
[window makeKeyWindow];
[window display];
this time, I have the warning twice, and then "Uncaught exception
NSPortTimeoutException, reason: invalidated while awaiting reply",
because the server segfaulted...
I made a third test: instead of doing "reader = (id
<FileReader)[NSConnection ...", I did "pointer = [NSConnection ...",
then tried to check if [pointer conformsToProtocol:
@protocol(FileReader)]; this made the server segfault too, and the
client complained (as expected) about the NSPortTimeoutException...
What did I do wrong this time?
Snark on #gnustep
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Distributed Objects question...,
PUYDT Julien <=