Secalles has asked for the wisdom of the Perl Monks concerning the following question:
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!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IO::Socket Listen
by Eliya (Vicar) on Dec 02, 2011 at 12:15 UTC | |
|
Re: IO::Socket Listen
by Marshall (Canon) on Dec 02, 2011 at 15:41 UTC | |
by Secalles (Initiate) on Dec 05, 2011 at 16:37 UTC | |
by Eliya (Vicar) on Dec 05, 2011 at 20:11 UTC | |
by Marshall (Canon) on Dec 06, 2011 at 10:24 UTC | |
by Secalles (Initiate) on Dec 06, 2011 at 13:51 UTC | |
by Eliya (Vicar) on Dec 06, 2011 at 14:26 UTC | |
|