Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Hi there,

i'm pretty new to Perl (in fact i started to learn last Friday...), so please forgive me.

There is a server in my local net (in fact it's a SD Card with a WiFi and webserver where you can download the pics the Camera just stored on the Card).

First of all my programm has to find the card on the network. That should be done by sending a UDP Broadcast from a specific to a specific port. The card Answers with a unicast to my PC telling it's IP Addr.

I'm using the following to send the Broadcast:

my $FindCard = IO::Socket::INET->new(Proto=>"udp",LocalPort=>58255,P +eerPort=>55777,PeerAddr=>"",Broadcast=>1) or die "Can't make UDP socket: $@"; $FindCard->send("");
And use this to get the answer:


Running Wireshark i see the Broadcast beeing send, and also the unicastanswer from the server. But my programm happily ignores this answer.

If i change the PeerAddr to the actual IP Address of the server and send the UDP datagram via unicast i get the same answer from the server, but my Programm is able the cope with it.

All i can think of is that in broadcast the PeerAddress i'm sending to and the address answering is different, so it is ignored.

I've tried searching the web for the whole weekend, but all i found where people having similar problems. But none could tell them what to do. So does anybody have a idea what i could search for?


In reply to Answer to a UDP Broadcast is ignored by Anonymous Monk

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (5)
    As of 2018-03-17 17:05 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (225 votes). Check out past polls.