I have a simple device that I need to send few lines of data in TCP
protocol.
The device should respond on each line sent.
I am using the following code:
#!/usr/bin/perl
use IO::Socket::INET;
my ($socket,$client_socket);
$socket = new IO::Socket::INET (
PeerHost => '192.168.0.20',
PeerPort => '5086',
Proto => 'tcp',
) or die "ERROR in Socket Creation : $!\n";
$socket->send("a\n");
$socket->recv($data, 128);
print "Data 1: $data\n";
$socket->send("111000\n");
$socket->recv($data, 128);
It seems that the device gets the first line but not the second line.
Does anyone have an idea what am I doing wrong?
--
Ori Idan
_______________________________________________
Linux-il mailing list
[email protected]
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il