"JRA" wrote in message
news:506500000005000000D1980000-1027480788000@exchange.ni.com...
> What exactly is it that you are wanting to do? Is your final goal to
> have multiple writers? If you only want one writer, then you only
> need one item. However, if you want multiple writers who can also
> read, you will need multiple items because you will have to open up
> one connection to an item for reading and another connection to
> another item for reading. Let me know a little more about what you're
> trying to accomplish and we'll look into this some more.
A client-server system for running a new instrument.
A server sits on the PC the instrument is connected to and accepts incoming
connection requests from remote clients. These remote clients may either be
monitor-only or may take control of the instrument to modify instrument
settings, load a new sample, start an experiment etc.
The model I'm going with so far has the server hook into a single public
item, statically defined in the Datasocket Server Manager and with the
"multiple writers" flag set. It broadcasts new data through this item as
data becomes available- typically a few times a second. Data transfer takes
place via "packets"- essentially an array of a few variants, passed as a
variant.
When a client wishes to connect, it writes a packet to the static broadcast
item containing information such as username and IP address. It also
contains a "cookie"- a random string of letters and digits. If the client is
authorised to connect, the server then creates two new dynamic items, each
of which has only one writer- one for client to server and one from server
to client. The names of the items are based around the "cookie" string.
Communication to all clients simultaneously then takes place via the static
"broadcast" socket and private communication takes place via the two dynamic
sockets.
My original post about performance was because I wasn't sure how the server
would hold up with many items being created and destroyed, but I've verified
that I can quite easily have a hundred or so clients all open at the same
time, and additionally have a few of them destroyed and a few new ones
created every second. It looks somewhat impressive and doesn't hammer the
machine (2 gig P4) particularly hard. So unless there's something wrong with
my approach that will cause me problems later, it looks like everything's
sorted.
--
Dr. Craig Graham, Software Engineer
Advanced Analysis and Integration Limited, UK