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. C#
  4. How to connect to a remote windows service

How to connect to a remote windows service

Scheduled Pinned Locked Moved C#
questiontutorial
5 Posts 3 Posters 7 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.
  • M Offline
    M Offline
    Mahmoud EL Shazly
    wrote on last edited by
    #1

    Hello, I have multiple clients, each one of them running windows service, How can I connect to that windows service and pass data to it ? I'm using signalR so I will pass the data from it's HUB Thanks in advance

    JusT LeT YouR MinD WorK

    F A 2 Replies Last reply
    0
    • M Mahmoud EL Shazly

      Hello, I have multiple clients, each one of them running windows service, How can I connect to that windows service and pass data to it ? I'm using signalR so I will pass the data from it's HUB Thanks in advance

      JusT LeT YouR MinD WorK

      F Offline
      F Offline
      F ES Sitecore
      wrote on last edited by
      #2

      The service needs to provide a useable interface that allows you to communicate with it. Most listen on a specific port for specifically formatted commands to be sent to it over TCP/IP. You can host something like WCF inside your service to make things simpler.

      1 Reply Last reply
      0
      • M Mahmoud EL Shazly

        Hello, I have multiple clients, each one of them running windows service, How can I connect to that windows service and pass data to it ? I'm using signalR so I will pass the data from it's HUB Thanks in advance

        JusT LeT YouR MinD WorK

        A Offline
        A Offline
        Afzaal Ahmad Zeeshan
        wrote on last edited by
        #3

        Quote:

        I'm using signalR so I will pass the data from it's HUB

        Since you are using SignalR, you do not require to connect to the Windows Service at all, just connect to the SignalR and let it do the work for you. Chances are you are using ASP.NET based SignalR (not the latest Core technologies), then you would have a good integration with Windows Service as well as the underlying system. Just make sure each of those machines are connected to the SignalR, so that there can a communication relay. Check this out for more on the topic, [SignalR with Self-hosted Windows Service](https://www.codeproject.com/Articles/881511/SignalR-with-Self-hosted-Windows-Service)

        The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

        M 1 Reply Last reply
        0
        • A Afzaal Ahmad Zeeshan

          Quote:

          I'm using signalR so I will pass the data from it's HUB

          Since you are using SignalR, you do not require to connect to the Windows Service at all, just connect to the SignalR and let it do the work for you. Chances are you are using ASP.NET based SignalR (not the latest Core technologies), then you would have a good integration with Windows Service as well as the underlying system. Just make sure each of those machines are connected to the SignalR, so that there can a communication relay. Check this out for more on the topic, [SignalR with Self-hosted Windows Service](https://www.codeproject.com/Articles/881511/SignalR-with-Self-hosted-Windows-Service)

          The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

          M Offline
          M Offline
          Mahmoud EL Shazly
          wrote on last edited by
          #4

          I thought the same but if I kept the client (Windows Service) connected to the signalR hub how can I receive the message ? since I don't have any page or GUI

          JusT LeT YouR MinD WorK

          A 1 Reply Last reply
          0
          • M Mahmoud EL Shazly

            I thought the same but if I kept the client (Windows Service) connected to the signalR hub how can I receive the message ? since I don't have any page or GUI

            JusT LeT YouR MinD WorK

            A Offline
            A Offline
            Afzaal Ahmad Zeeshan
            wrote on last edited by
            #5

            Quote:

            how can I receive the message ?

            You _will_ receive the message, you will just not see the message. That is the basic concept of a Windows Service. They are UI-less, because of their design. If you want to see the message in real-time, then either use a UI-based framework, or consider reading the messages from an external source, such as a Queue that processes the messages as they come. [Queuing Windows Services work items using MSMQ, and live progress using WCF Net Named Pipe](https://www.codeproject.com/Articles/846586/Queuing-Windows-Services-work-items-using-MSMQ-and)

            The shit I complain about It's like there ain't a cloud in the sky and it's raining out - Eminem ~! Firewall !~

            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