Search code examples
c#wpfwcfsynchronizationwcf-client

Recommendations on a Client Host application in .Net


My question is concerning an application that will use a host application where the database server is, and a few clients that will be sending information to the host.

Basically the host application receives some data from the clients, makes some calculations and error checking and then (if all goes well) it stores the information in the database. The data received could be easily serialized or get character separated in a string of less than 50 characters.

I know my basic option in developing this communication application is WCF and have worked with it before but my concerns for this particular case is the fact that:

  1. The host and the clients will at most times be connected to the internet through wireless USB modems which as we all know do not provide the most reliable connection ever.

  2. There will be many clients all sending information to the host at the same time, each having their own identification id since that determines the type of the data received and what it represents.

  3. Due to the not so reliable connections i would like to be able to know if the packet has been sent successfully, and if not to be able to keep trying until the communication is complete.

  4. New data will be sent from each client every couple of minutes and if lets say we have a connection failure for 5 minutes i would like to be able to send all unsent information when the connection is restored.

  5. Lastly i'm kind of trying to figure how i would be able to know where to contact the host as the usb modems do not have a static ip and this could change from time to time.

My thought is to either try to establish a communication through WCF services where the clients would send all information to the host directly or maybe consider serializing the data from the clients in XML format, then upload them on a 3rd server that will be available all of the time, and then use the host application every one minute to try and synchronize the available information with the ones one the 3rd server.

Hope i made it pretty clear with this lengthy post on what i'm trying to accomplish and would really appreciate your thoughts for a project like this.


Solution

  • Instead of starting a discussion. Ill try and give you an answer.

    I have implemented a system your describing. Based on that experience i can tell you that you will be wanting to look at a message based system to do the communication between your clients and host(s).

    A message based system allows you to transparently handle the communication going on. It allows to you resend a message in case it failed to transmit.

    To keep it short there are various message based frameworks available for the .Net community. To name a few: NServiceBus, Mass Transit, Rhino Service Bus, or maybe the more lightweight Agatha RRSL.

    Point is, there are quite a few. Its up to you to research em and find out which one suits your needs best.