NSConnections etc.
NSConnections etc.
- Subject: NSConnections etc.
- From: email@hidden
- Date: Wed, 7 Aug 2002 10:55:22 -0500
Here is a brief list of things that make me go "hmmmmmm..."
Any tips would be appreciated.
[Question 1]
When experimenting with distributed objects I have had some difficulty getting the client to connect to the server.
The follwing code connects and returns a valid server :)
my_server = [NSConnection rootProxyForConnectionWithRegisteredName:@"server" host:nil];
This code does not connect, and returns nil :(
my_server = [NSConnection rootProxyForConnectionWithRegisteredName:@"server" host:@"localhost"];
This code also returns nil :(
my_server = [NSConnection rootProxyForConnectionWithRegisteredName:@"server" host:[[NSProcessInfo processInfo]
hostName]];
Clearly I fail to grok the fullness of the "host:" argument.
Can anyone point me in the right direction?
[Question 2]
This code (error checking removed for clarity) works.
FILE* fp = fopen("/users/thenry/afile.abc", "rb");
fseek(fp, 0L, SEEK_END);
*sizep = ftell(fp);
rewind(fp);
*bufp = calloc(*sizep, 1);
count = read(fileno(fp), *bufp, *sizep);
if (count != *sizep)
printf("read failed, %d of %d bytes returned\n", count, *sizep);
However, changing the file name to "/volumes/mac share/tbh/afile.abc"
i.e., FILE* fp = fopen("/volumes/mac share/tbh/afile.abc", "rb");
does not. It actually does work all the way up to the read(), which fails, yielding the following message:
"read failed, 0 of 65550 bytes returned"
The other calls all appear to function correctly (else how did it open and obtain the correct file size).
I wonder is it the attempt to access a different volume, or is it the fact that the volume in
question is a W2K file server with a mac share partition (no I don't know how the file server is configured...).
(Aside: does the "b" in "rb" on the fopen have any meaning on a Mac?)
Again, any insight would be appreciated.
Thanks in advance,
Trenton Henry
SMSC
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.