Re: networking advice.
Re: networking advice.
- Subject: Re: networking advice.
- From: Peter Sichel <email@hidden>
- Date: Mon, 22 Oct 2001 08:56:48 -0400
I've been doing similar work using Distributed Objects (DO) per
the Cocoa SimpleThreads example.
I do as much networking as possible in the server threads themselves
and mostly send back user interface updates.
- Peter
i'm developing an application that is a client for a tcp protocol.
i have code which connects to the server using Socket (from
http://sourceforge.net/projects/smallsockets/). obviously when I
write data to this socket it sends my protocol to the server, and
then when i read, it gets any responses from it. i can be in
blocking or in non-blocking mode.
the question is, what's a good appkit model to structure the
separation between the network communications and the ui?
here's what i'm thinking: start a thread which opens the
connection, and manages the protocol parsing etc... and message back
to the "controller" thread with results/state changes. that way the
UI is never stuck waiting for network results. the question is
really how should i message between that network thread and any
consumers/producers of network packets?
method calls with nslocks around them?
the event system?
notifications?
any advice would be appreciated.
--