Sockets in .NET Windows Service

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bkkirankumar
    New Member
    • Sep 2008
    • 3

    Sockets in .NET Windows Service

    Hi,

    I had used Sockets in my windows service which is being developed in C#. Earlier I wrote an application and I converted that to service. But the sockets are being blocked(or) not initializing. I am using this to receive multicast streams. Please let me know for any suggestions or answers.

    Thanks in advance
    Black
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    Ammend your firewall instructions to allow your sockets to go through.

    Comment

    • bkkirankumar
      New Member
      • Sep 2008
      • 3

      #3
      I had completly disabled the firewall. But I am unable to connect in Windows Service. When I ported the same code to Windows Forms application, it worked fine. Thanks in advance

      Comment

      • pootle
        New Member
        • Apr 2008
        • 68

        #4
        Could it be a permission problem? Are you running on Vista?

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          Ooo yeah, make sure your service runs as administrator and see if the sockets connect.
          If not, you are going to need to put some sort of output logic in your code so you can track whats going on (unless you can debug services, in which case a breakpoint and stepping through code will work)

          Comment

          • tatkosmurff
            New Member
            • Sep 2008
            • 5

            #6
            check the Allow data transfer between service and desctop option.
            Service properties, second tab

            I use the same structure(servi ce that runs a TCP server), but I never had
            such problems. If it runs as an exe application you´ll have to check the service
            presets.

            Comment

            • bkkirankumar
              New Member
              • Sep 2008
              • 3

              #7
              Originally posted by tatkosmurff
              check the Allow data transfer between service and desctop option.
              Service properties, second tab

              I use the same structure(servi ce that runs a TCP server), but I never had
              such problems. If it runs as an exe application you´ll have to check the service
              presets.
              I had checked the service to allow "Interact with Desktop" and Administrator options, even with Network Service option. I had debugged the service but it fails only when kSocket.Send(.. .). encounters. I had written several services but this is my first one with sockets. Please help. Thanks

              and forgot.. I am using "Socket" class.

              Comment

              • Plater
                Recognized Expert Expert
                • Apr 2007
                • 7872

                #8
                Well what is the exception that is thrown when you reach the .Send() call? It might tell you something usefull.

                Comment

                Working...