"An address incompatible with the requested protocol was used"

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • channau2
    New Member
    • Nov 2008
    • 3

    "An address incompatible with the requested protocol was used"

    HI,
    i am trying to create a simple UDP client application on the windows mobile using c# to send messages as data packets to a desktop pc. I am getting this error when deploy the application on windows mobile;

    "An address incompatible with the requested protocol was used"
    i am very new to windows mobile application development and this is partof my final year project. Can someone please give me some clues why i am getting this error? I need to solve this problem urgently

    the bit of code that generates the error is as follows:

    Code:
    string packet = "Hello";
    byte[] data = System.Text.Encoding.ASCII.GetBytes(packet);
    client.Send(data, data.Length, "127.0.0.1", 50000);
    Thanks is advance..

    Channa

    <edit by mod: use [CODE] and [QUOTE] tags, not [B] and [U]>
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    The error you are getting indicates that the address 127.0.0.1 does not support UDP. If your phone is not network or ethernet compatible then sending data to the loopback will not work.

    You should try using the WM 5 emulator instead of a real device, it can use your computers NIC to communicate with itself and the outside world.

    Comment

    • channau2
      New Member
      • Nov 2008
      • 3

      #3
      Originally posted by RedSon
      The error you are getting indicates that the address 127.0.0.1 does not support UDP. If your phone is not network or ethernet compatible then sending data to the loopback will not work.

      You should try using the WM 5 emulator instead of a real device, it can use your computers NIC to communicate with itself and the outside world.

      Hi,

      Thanks alot for your reply.I do use the emulator to test the application and never tried it with the actual device. and i tried both WM5 and WM6 emulators . i have installed the Virtual PC 2007 and Activesysnc to support the emulator to connect wiht NIC... this was sugested in one of the articles i red. but i am still getting the same error.... is there anything else that i have to do??? any configurations in the emulator or change the code????

      Thanks in advance.......


      Regards

      Channa

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        Can you connect to websites and other things from the emulator?

        Comment

        • channau2
          New Member
          • Nov 2008
          • 3

          #5
          Originally posted by RedSon
          Can you connect to websites and other things from the emulator?
          HI,

          Yes i can browse internet from the emulator......

          Regards

          Channa

          Comment

          Working...