• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Symmetric Distributed Objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Symmetric Distributed Objects


  • Subject: Symmetric Distributed Objects
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Tue, 18 Jul 2006 11:20:05 +0200

I have two computers, both run identical copies of MyApp.

MyApp does at start:
p = [ NSSocketPort initWithTCPPort: 56789 ]
c = [NSConnection initWithReceivePort: p sendPort: nil ]
[ c setRootObject: self ]
[ NSNetService initWithDomain: @"" type: @"_MyApp._tcp." name: hostname port: 56789] - publish.
[ NSNetServiceBrowser searchForServicesOfType: @"_MyApp._tcp." inDomain: @"" ]


The NSNetServiceBrowser will find itself and MyApp on the other computer.

Occasionally MyApp does:
[ NSNetService initWithDomain: @"local." type: @"_MyApp._tcp." name: peerName ]; [ ns resolveWithTimeout: 2.7 ].
It gets an address, creates an NSPort, NSConnection.
Finally does proxy = [ connectionToPeer rootProxy ] and starts talking to the peer.


This works ok 99% of the time.
But sometimes [ connectionToPeer rootProxy ] takes 75 seconds and then returns nil.


Question: is this scenario - both copies of MyApp acting as server and occasionally as client; both using the same port - ok?
Or is it principally wrong and only works by some happy chance?


Gerriet.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Symmetric Distributed Objects
      • From: "Jim Thomason" <email@hidden>
  • Prev by Date: Re: NSPopUpButtonCell as NSTableView header problem
  • Next by Date: Re: Writing application without Interface Builder
  • Previous by thread: NSURLConnection + SSL Certificate
  • Next by thread: Re: Symmetric Distributed Objects
  • Index(es):
    • Date
    • Thread