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