Hi Monks ,

I wrote this simple code because I just want to send some information to a device , the program sends the query (I used wireshark and saw the package leaving corrertly my machine and the device responded correctly too ) but I can't recieve this info in my program and i don't know what to do , here is the code

use IO::Socket; #Sender my $send = new IO::Socket::INET ( PeerAddr => '192.168.11.244', PeerPort => '6008', Proto => 'tcp', ); die "Couldn't Send: $!\n" unless $send; #Reciever my $recieve = new IO::Socket::INET ( LocalHost => '192.168.11.136', LocalPort => '6008', Proto => 'tcp', Listen => 1, Reuse => 1, ); die "Couldn't Recieve: $!\n" unless $recieve; $data = pack("CccccccCcCC",02,65,63,80,81,76,86,03,100,13,10); print $send $data ; #close($send); my $new_sock = $recieve->accept(); while(<$new_sock>) { print $_; } close($recieve);

I appreciate any help!

Thanks in advanced!


In reply to IO::Socket Listen by Secalles

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.