1. I get the following printed "Listening on host_port" on my command line after the following executes. Did I do something wrong with the $sock_r->sockport?
$sock_r = IO::Socket::INET->new(Proto => "udp") or die "can't connect socket to port: $!"; $host_port = $sock_r->sockport; print "Listening on host_port $host_port\n";
2. Here is the entire datagram, where I sent from 186.1.238.176:32770 the message: "Ftest 01234 4" to 186.1.228.4:5152. The command line and contents of the UDP payload are below, the datagram appears to be ASCII encoded data.
print $sock_w "test 01234 $test"; 00 08 74 4A 64 A0 00 02 FD B1 41 C2 08 00 45 00 ..tJd.....A...E. 00 28 A7 6B 40 00 3D 11 4F A1 BA 01 EE B0 BA 01 .(.k@.=.O....... E4 04 80 02 14 20 00 14 98 46 74 65 73 74 20 30 ..... ...Ftest 0 31 32 33 34 20 34 1234 4
Should I be writing to the socket differently to send binary data? If so, what is the syntax?

In reply to Re: Re: UDP socket questions by sbrandt
in thread UDP socket questions by sbrandt

Title:
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, details, 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, summary, 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.