Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Smart Clients and Client-Server Modules

Smart Clients and Client-Server Modules

Scheduled Pinned Locked Moved .NET (Core and Framework)
tutorialquestionsysadminhardware
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    Vega02
    wrote on last edited by
    #1

    I am developing a "smart program" of sorts in the sense that there are many client programs and one server. At the moment, the clients are communicating with the server using a NetworkStream. My goal in this software is to have multiple "module pairs" residing on the server that the clients can choose to run at their discretion. This is the way that I have the framework for this suite set out right now: - Client opens communication with server using NetworkStream - Client requests a list of all installed modules on the server - Client chooses a module to run. At this time the server launches its own executable for that module (i.e. something that would interface with the hardware sitting on the server to take test data). Additionally, the server sends the client an executable (down the NetworkStream) that it can use to view that data. An example of this would be a module pair that displays outside temperature. The server would have the thermometer hooked into a port, and the server half of this module pair would just take readings every so often. The client half of this module pair would display the temperature reading and various options, and it would communicate with the server half of the module pair. I imagine that it would display a form to accomplish this, and I would like to have that form as a MDI child of the main application window. I already have a method for the client and server halves of the module pair to communicate, so this does not concern me at the moment. However, I've detailed it here if it helps or if it piques your curiosity. :) The client and server (applications) expose a class conforming to the Stream interface, but this class just tags the communication with an ID and sends it across the common NetworkStream. The receiver reads the ID and forwards the data packet to the correct Stream. In other words, it's just like the client and server module halves have their own dedicated Stream, but in reality it's all being sent through one already established NetworkStream. Ok, so now my actual question. I *don't* know how to get the client module half from the server's repository to the client itself. My original plan called for simply sending the executable itself and launching it client-side, but this doesn't take into account things like dependencies. Is there any way for me to transport a fully self-contained assembly to the client for it to execute? Am I making things overly complicated? Perhaps there's a much better way to do this that I'm not thinking of. I

    S 1 Reply Last reply
    0
    • V Vega02

      I am developing a "smart program" of sorts in the sense that there are many client programs and one server. At the moment, the clients are communicating with the server using a NetworkStream. My goal in this software is to have multiple "module pairs" residing on the server that the clients can choose to run at their discretion. This is the way that I have the framework for this suite set out right now: - Client opens communication with server using NetworkStream - Client requests a list of all installed modules on the server - Client chooses a module to run. At this time the server launches its own executable for that module (i.e. something that would interface with the hardware sitting on the server to take test data). Additionally, the server sends the client an executable (down the NetworkStream) that it can use to view that data. An example of this would be a module pair that displays outside temperature. The server would have the thermometer hooked into a port, and the server half of this module pair would just take readings every so often. The client half of this module pair would display the temperature reading and various options, and it would communicate with the server half of the module pair. I imagine that it would display a form to accomplish this, and I would like to have that form as a MDI child of the main application window. I already have a method for the client and server halves of the module pair to communicate, so this does not concern me at the moment. However, I've detailed it here if it helps or if it piques your curiosity. :) The client and server (applications) expose a class conforming to the Stream interface, but this class just tags the communication with an ID and sends it across the common NetworkStream. The receiver reads the ID and forwards the data packet to the correct Stream. In other words, it's just like the client and server module halves have their own dedicated Stream, but in reality it's all being sent through one already established NetworkStream. Ok, so now my actual question. I *don't* know how to get the client module half from the server's repository to the client itself. My original plan called for simply sending the executable itself and launching it client-side, but this doesn't take into account things like dependencies. Is there any way for me to transport a fully self-contained assembly to the client for it to execute? Am I making things overly complicated? Perhaps there's a much better way to do this that I'm not thinking of. I

      S Offline
      S Offline
      Serge Lobko Lobanovsky
      wrote on last edited by
      #2

      LeviB wrote: Is there any way for me to transport a fully self-contained assembly to the client for it to execute? Hi, Why not prepare ZIP archives on the server which contain all the neccessary modules for running the "client half" on the client, and send them instead? Just unzip on the client to a folder per "client module half" and run. Does this make sense in your project? Btw, I really liked your app description :) Regards, Serge (Logic Software, Easy Projects .NET site)

      V 1 Reply Last reply
      0
      • S Serge Lobko Lobanovsky

        LeviB wrote: Is there any way for me to transport a fully self-contained assembly to the client for it to execute? Hi, Why not prepare ZIP archives on the server which contain all the neccessary modules for running the "client half" on the client, and send them instead? Just unzip on the client to a folder per "client module half" and run. Does this make sense in your project? Btw, I really liked your app description :) Regards, Serge (Logic Software, Easy Projects .NET site)

        V Offline
        V Offline
        Vega02
        wrote on last edited by
        #3

        Yeah, I thought about just zipping it up and letting it go, but that would require the people who write the modules to make a list of all necessary assemblies beforehand. I was looking for something more along the lines of the server determining which files are required at runtime, then sending the entire dependency tree down the stream until the client can reconstruct everything. Thanks for the response! :-D

        S 1 Reply Last reply
        0
        • V Vega02

          Yeah, I thought about just zipping it up and letting it go, but that would require the people who write the modules to make a list of all necessary assemblies beforehand. I was looking for something more along the lines of the server determining which files are required at runtime, then sending the entire dependency tree down the stream until the client can reconstruct everything. Thanks for the response! :-D

          S Offline
          S Offline
          Serge Lobko Lobanovsky
          wrote on last edited by
          #4

          Hi again, Have you found a solution yet? If not, there is one more hint: Use Assembly.GetReferencedAssemblies() method for determining all the neccessary assemblies for your application. It returns an array of AssemblyNames. Regards, Serge (Logic Software, Easy Projects .NET site)

          V 1 Reply Last reply
          0
          • S Serge Lobko Lobanovsky

            Hi again, Have you found a solution yet? If not, there is one more hint: Use Assembly.GetReferencedAssemblies() method for determining all the neccessary assemblies for your application. It returns an array of AssemblyNames. Regards, Serge (Logic Software, Easy Projects .NET site)

            V Offline
            V Offline
            Vega02
            wrote on last edited by
            #5

            I'll try this - thanks!

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups