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 Find Client Network cable is unplugged or plugged in [modified]

How to Find Client Network cable is unplugged or plugged in [modified]

Scheduled Pinned Locked Moved C#
helpsysadmintutorial
9 Posts 3 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.
  • S Offline
    S Offline
    sindhutiwari
    wrote on last edited by
    #1

    hi in my application i am sending message to a client using socket now if the clients network cable is unplugged ...still the messages which i am sending are going without any error .....now this is creating a problem so if any one knows how to know the clients network cable is plugged in or not please do let me know ......as i am strucked at this point regards sindhu tiwari

    Always Innovative

    modified on Saturday, January 05, 2008 3:12:21 AM

    M P 2 Replies Last reply
    0
    • S sindhutiwari

      hi in my application i am sending message to a client using socket now if the clients network cable is unplugged ...still the messages which i am sending are going without any error .....now this is creating a problem so if any one knows how to know the clients network cable is plugged in or not please do let me know ......as i am strucked at this point regards sindhu tiwari

      Always Innovative

      modified on Saturday, January 05, 2008 3:12:21 AM

      M Offline
      M Offline
      mav northwind
      wrote on last edited by
      #2

      Hi! What kind of protocol are you using? Sockets can be used for all kinds of protocols, some of them containing ways to ensure that a message has been received, while others (like UDP, for example) don't give you this option.

      Regards, mav -- Black holes are the places where God divided by 0...

      S 1 Reply Last reply
      0
      • M mav northwind

        Hi! What kind of protocol are you using? Sockets can be used for all kinds of protocols, some of them containing ways to ensure that a message has been received, while others (like UDP, for example) don't give you this option.

        Regards, mav -- Black holes are the places where God divided by 0...

        S Offline
        S Offline
        sindhutiwari
        wrote on last edited by
        #3

        TCP/IP .......

        its me sid

        M 1 Reply Last reply
        0
        • S sindhutiwari

          TCP/IP .......

          its me sid

          M Offline
          M Offline
          mav northwind
          wrote on last edited by
          #4

          How about showing some code or being a little more verbose? It's almost impossible to help you if every single piece of information has to be wormed out of you...X| If you're using a TcpClient for example, the call to Connect will throw an exception if the remote partner is not available, you can get a SocketException when writing to a NetworkStream with a disconnected remote partner, and so on. So what exactly are you doing and where do you need the information if the remote part is there?

          Regards, mav -- Black holes are the places where God divided by 0...

          S 1 Reply Last reply
          0
          • M mav northwind

            How about showing some code or being a little more verbose? It's almost impossible to help you if every single piece of information has to be wormed out of you...X| If you're using a TcpClient for example, the call to Connect will throw an exception if the remote partner is not available, you can get a SocketException when writing to a NetworkStream with a disconnected remote partner, and so on. So what exactly are you doing and where do you need the information if the remote part is there?

            Regards, mav -- Black holes are the places where God divided by 0...

            S Offline
            S Offline
            sindhutiwari
            wrote on last edited by
            #5

            i am using this thing to send a ping to the client system..fine so suppose the network cable is unplugged still the server is sending the ping ...now when the system shut downs unexpectedlly due to power then the message is not send a exception is coming ..my doubt is why this expection is not raised when network cable is unplugged regards sindhu tiwari

            its me sid

            M 1 Reply Last reply
            0
            • S sindhutiwari

              i am using this thing to send a ping to the client system..fine so suppose the network cable is unplugged still the server is sending the ping ...now when the system shut downs unexpectedlly due to power then the message is not send a exception is coming ..my doubt is why this expection is not raised when network cable is unplugged regards sindhu tiwari

              its me sid

              M Offline
              M Offline
              mav northwind
              wrote on last edited by
              #6

              Once again - without any code it's impossible to tell where you're going wrong!

              Regards, mav -- Black holes are the places where God divided by 0...

              1 Reply Last reply
              0
              • S sindhutiwari

                hi in my application i am sending message to a client using socket now if the clients network cable is unplugged ...still the messages which i am sending are going without any error .....now this is creating a problem so if any one knows how to know the clients network cable is plugged in or not please do let me know ......as i am strucked at this point regards sindhu tiwari

                Always Innovative

                modified on Saturday, January 05, 2008 3:12:21 AM

                P Offline
                P Offline
                Patrick Etc
                wrote on last edited by
                #7

                Take a look at the System.Net.NetworkInformation namespace. It contains a class called NetworkChange which contains two events: NetworkAddressChanged tells you when an IP address has changed, and NetworkAvailabilityChanged tells you when any network's availability changes. This, incidentally, is the same event Windows uses when it shows you the little notification balloon in the task tray when a cable is unplugged - they hook into the same operating system message. That namespace contains a number of other extremely interesting and useful classes, so spend some time exploring it. You can do pretty much anything you need to with networks using that namespace.


                It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein

                S 1 Reply Last reply
                0
                • P Patrick Etc

                  Take a look at the System.Net.NetworkInformation namespace. It contains a class called NetworkChange which contains two events: NetworkAddressChanged tells you when an IP address has changed, and NetworkAvailabilityChanged tells you when any network's availability changes. This, incidentally, is the same event Windows uses when it shows you the little notification balloon in the task tray when a cable is unplugged - they hook into the same operating system message. That namespace contains a number of other extremely interesting and useful classes, so spend some time exploring it. You can do pretty much anything you need to with networks using that namespace.


                  It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein

                  S Offline
                  S Offline
                  sindhutiwari
                  wrote on last edited by
                  #8

                  Thanks for ur reply... The main thing is that i want to know the network details about the client so if u have any idea how to implement this then please let me know

                  its me sid

                  P 1 Reply Last reply
                  0
                  • S sindhutiwari

                    Thanks for ur reply... The main thing is that i want to know the network details about the client so if u have any idea how to implement this then please let me know

                    its me sid

                    P Offline
                    P Offline
                    Patrick Etc
                    wrote on last edited by
                    #9

                    The NetworkInformation namespace contains a class that provides information about the connected networks, as well - IP address, network type, speed, etc.


                    It has become appallingly obvious that our technology has exceeded our humanity. - Albert Einstein

                    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