Re: [Q] efficient or good model for send/receive with streams scheduled in runloop?
Re: [Q] efficient or good model for send/receive with streams scheduled in runloop?
- Subject: Re: [Q] efficient or good model for send/receive with streams scheduled in runloop?
- From: Shawn Erickson <email@hidden>
- Date: Wed, 28 Jan 2009 15:51:59 -0800
On Tue, Jan 27, 2009 at 8:33 AM, JongAm Park
<email@hidden> wrote:
> However, I have difficulty in making it to send data and receive ack from a
> server.
> Sometimes, it receives some meaningful data about changed information from a
> server, if a client send a request to change some data.
> But sometimes it also receives ack.
> So, I would like to make it do next job after receiving an ack.
OK sounds good so make it do the next job.
> So, I embraced a send routine with a lock. But the whole client process is
> in dead-lock status, because it is not multi-threaded.
> ( a receive routine already locked. )
A lock? As in NSLock, etc.? Why do you think you need a lock here
given it isn't multi-thread and the fact that IO appears to be driven
by a runloop which will serialize access for you.
> Under this situation, is there a good network programming model or pattern?
> How should I solve this issue?
You gave us very little actionable information, we can only guess at
your implementation. You will have to provide more details and ideally
sample code.
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden