Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QUdpSocket direct connection
Forum Updated to NodeBB v4.3 + New Features

QUdpSocket direct connection

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 1.9k 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.
  • B Offline
    B Offline
    bareil76
    wrote on last edited by
    #1

    Hi All,

    If I connect my device via a router, it works perfectly.
    If I connect directly to the computer, I get a 169.254.214.29 IP address it won't work.
    If I connect directly to the computer and manually change my IP address to 192.168.1.xxx, it works!!!
    If I connect directly to the computer and manually change my IP address to 169.254.214.29, it doesnt work.

    In ALL cases, if I look with Wireshark, it always work. I cannot event send a datagram with 169.254.214.29. Wireshark does see my datagrams being send out.

    What is happening?

    Thanks!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      It is not a QUdpSocket issue.
      It is basic networking question.

      169.254.x.x is a link-local address range.
      A device gets an address from this range if there is no any address assignment made by admin or by dhcp.
      When you enter address manually the device gets only default route and 169.254.x.x is not part of default route.
      If you need to route 169.254.x.x then you need to create a route manually. How to do it depends on OS.
      on Linux for example
      @
      route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 99
      @

      1 Reply Last reply
      0
      • B Offline
        B Offline
        bareil76
        wrote on last edited by
        #3

        ok! I understand.

        Do you have a CMD example for windows laying around?

        [quote author="andreyc" date="1418321135"]It is not a QUdpSocket issue.
        It is basic networking question.

        169.254.x.x is a link-local address range.
        A device gets an address from this range if there is no any address assignment made by admin or by dhcp.
        When you enter address manually the device gets only default route and 169.254.x.x is not part of default route.
        If you need to route 169.254.x.x then you need to create a route manually. How to do it depends on OS.
        on Linux for example
        @
        route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0 metric 99
        @[/quote]

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andreyc
          wrote on last edited by
          #4

          Something like this
          @
          route add 169.254.0.0 mask 255.255.0.0 192.168.0.1 metric 99
          @

          But I have not tested it.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bareil76
            wrote on last edited by
            #5

            I Have tried

            @route add 169.254.214.29 mask 255.255.0.0 192.168.0.1 metric 99@

            But I get

            @The route addition failed: The parameter is incorrect.@

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andreyc
              wrote on last edited by
              #6

              I guess you need to use interface instead of router ip
              Take a look "here":http://windowsitpro.com/networking/q-when-i-add-static-ip-route-what-value-do-i-use-interface

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved