networking advice.
networking advice.
- Subject: networking advice.
- From: Tom Waters <email@hidden>
- Date: Sat, 20 Oct 2001 14:52:09 -0700
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.