Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Easy Networking (DO) Question

Easy Networking (DO) Question
Thread Tools
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
Oct 19, 2004, 07:44 AM
 
Hi,

I have a networking application that uses distributed objects (DO) for communication between the server and client. The server pings the client every once in a while to make sure that it is still there. I am running into a problem where if the client has a modal sheet down and the ping occurs, the client does not respond and the server ends up thinking the client is no longer there.

So my question is: do you think I should have my connections happen in a different thread, or before the client beings a modal sheet should it tell the server that it is in a modal state. Or, is there a better alternative all together?

Feedback appreciated.
~Ian
     
Mac Elite
Join Date: Sep 2000
Location: Tempe, AZ
Status: Offline
Reply With Quote
Oct 19, 2004, 11:53 AM
 
I'd say to use a separate thread. It's not particularly tough to do, and it'll get around the problem nicely.

If you have any variables that are shared between your new thread and the main thread, make absolutely sure to lock a shared NSLock before you access them. And don't do UI stuff from your new thread - if you need to, message the main thread and have it done there.
Geekspiff - generating spiffdiddlee software since before you began paying attention.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Oct 19, 2004, 12:54 PM
 
You could have the connection listen in more than just NSDefaultRunLoopMode (for example, kCFRunLoopCommonModes). That seems like the simplest way to do it.
(Last edited by Chuckit; Oct 19, 2004 at 01:01 PM. )
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
Oct 19, 2004, 01:32 PM
 
I tried this and it worked:

[NSApp beginSheet....


[NSApp abortModal];

This allows the sheet to come down and everything looks and works fine, but we are not in a modal session so my client still receives messages from the server. Or at least that is what I think is going on
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:16 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2