Re: Distributed Objects over Network
Re: Distributed Objects over Network
- Subject: Re: Distributed Objects over Network
- From: Charles Bennett <email@hidden>
- Date: Mon, 09 Jul 2001 09:03:47 -0400
AFAIK: you are only going to be able to do this via a TCP socket at the moment.
This works for me.. May not be exactly right, as I'm typing in the email message,
not pasteing it in..
//server (init the RECEIVE port as it LISTENS for connections)
NSSocketPort *port = [[NSSocketPort alloc] initWithTCPPort:1234];
NSConnection *connection = [[NSConnection alloc] initWithReceivePort:port sendPort:nil]];
[connection setRootObject:whateverYourVending];
and you are done..
//client (init the SEND port as it MAKES connections)
id server;
NSSocketPort *port = [[NSSocketPort alloc] initWithTCPPort:1234 host:@"somehost" ]];
NSConnection *connection = [NSConnection connectionWithReceivePort:nil sendPort:port];
server = [connection rootProxy];
[server setProtocolForProxy:@protocol(someprotocol)];
.... and away you go..
The old NeXTSTEP way of using "*" to search the subnet isn't going to work
anymore if I understood Douglas Davidson's post.
Here is the guist of his post
Douglas Davidson wrote:
>
>
On Friday, June 22, 2001, at 09:41 AM, Michael Giddings wrote:
>
>
> Thanks very much. Given this example, I was able to find an earlier
>
> message from Chris Kane at apple (2/24/01) showing the same approach.
>
> I tried it this way, and it works. The only downside is it appears you
>
> have to know the host where the server is located ahead of time
>
> (i.e. "*" does not seem to work for hostname). But that's much better
>
> than it not working at all.
>
>
As you will recall, on the Mach 2.5-based systems, you could use "*" for
>
the hostname. What that did, on those systems, was to cause a UDP
>
broadcast packet to be sent out, requesting a response from any machine
>
on the local network segment that recognized the service name you
>
specified. This was convenient in some circumstances, but it also had a
>
number of problems. I think it is not too much to ask that you discover
>
the host of interest yourself by some other means and specify it to DO.
>
Among other things, this gives you a chance to determine which host you
>
are dealing with, and verify that it is really the host you intended.
>
>
Douglas Davidson
>
_______________________________________________
>
MacOSX-dev mailing list
>
email@hidden
>
http://www.omnigroup.com/mailman/listinfo/macosx-dev
This does beg the question of why registering a name works at all
even to the point that trying to register a name twice will fail.
Of course trying to look it up always returns nil. Perhaps this is a leftover of the
code for looking up a service..
In any case one of these methods is now a bug. Either I shouldn't be able to register
an object by name (at all) OR I should be able to look it up, at least by explict name if not
by "*"
Good o'l Yoda.. There is no try, there is DO or DO NOT :-) (couldn't resist the DO--Distributed Object pun.. sorry)
chuck
Eric Clements wrote:
>
>
I've tried specific IP addresses, hostnames, everything. Nothing seems
>
to make it work over the network. Any other ideas out there?
>
>
Thanks,
>
>
On Monday, July 9, 2001, at 01:15 AM, Art Isbell wrote:
>
>
> On Sunday, July 8, 2001, at 02:09 PM, Eric Clements wrote:
>
>
>
>> I am using Distributed Objects to share objects between 2
>
>> applications. They work locally on the same machine when I use "nil"
>
>> for the host: parameter, but does not work over the Network between
>
>> hosts with "host:" set to @"*" (see below). My goal is to have them
>
>> work over the network and I am having NO LUCK. Does anyone know if I
>
>> have to do something special to make them work...
>
>
>
> I think a hostname of @"*" sends a broadcast message which won't
>
> be routed, so the client needs to be on the same subnet.
>
>
>
> Have you tried specifying the server hostname that can be resolved
>
> by DNS or else an IP address?
>
>
>
> Mac OS X comes pretty battened up against outside communications,
>
> so maybe there's something on the server that needs to be enabled for
>
> DO communications to succeed. Problem is, I don't know what that might
>
> be.
>
>
>
> Art Isbell
>
> Apple iServices Technical Support
>
> http://www.apple.com/iservices/webobjectssupport/
>
> +1-808-591-0836
>
_______________________________________________
>
cocoa-dev mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
--
What parts of "shall make no law", "shall not be infringed",
and "shall not be violated" don't you understand?