Keep a list of objects up to date over the network with C#
I'm an beginner programer who is trying to have a list of objects stored
on a server and clients can connect and view/edit this list.
I will try to explain as best I can what my set up is.
Server: This will hold a "Main List" that contains all the objects of that
list type. When a Client wants an update this list needs to be passed to
the client so they can read it.
Client: The clients will read the updated list from the server and when
they make a change to the list this change needs to be sent to the server.
Right now I'm thinking I make it to where only 1 client can edit the list
at any time, and since things can be added/remove/changed/location in list
changed I think it would be best to just have the client send their list
to the server to replace the servers. This way since only 1 will be
editing the list the list should stay updated.
My problem is that I can't find a somewhat simple way to send a list of
objects through the network. Currently I might be able to pull it off by
taking one object at a time converting it to XML then back, but since it's
a list that requires much much code. I'm hoping someone knows of an easier
way to move a list of objects through the network or converting a list of
objects to a string/back again.
An easy example of what I'm doing is imagine pictures on a field that
people can click and move, so I need to keep track of the order of images,
the x/y and the image name. That is a rough example.
Please let me know what you think, any help would be appreciated. I'm a
beginner so I apologize for any incorrect terminology.
Thank you.
No comments:
Post a Comment