I'm using UDP (because the server only accepts UDP, I didn't write it) to receive some data from the server and it's not getting all the data. I know there's at least 18-19 lines I need to receive but I'm only getting 13-14 of them. I've tried increasing the length and even adding a sleep to see if it just needs more time to get it all but nothing. I still only get so many lines back. Anyone got any tips?
Like I mentioned, I've tried 6000 to 30000, still only so much comes through. No errors or nothing.
Side question: is there anyway to dump the returned data to an array instead of a scalar? I've tried using @data instead of $data and it gives me a usage error:
Code:
my $sock = IO::Socket::INET->new(Proto =>'udp',
PeerHost =>$host,
PeerPort =>$port,
Reuse => 1) or die $@;
my $packet = "getinfo";
$sock->send($packet);
$sock->recv($data,6000) or die "failed to recv() !:\n";
sleep 5;
print $data;
Like I mentioned, I've tried 6000 to 30000, still only so much comes through. No errors or nothing.
Side question: is there anyway to dump the returned data to an array instead of a scalar? I've tried using @data instead of $data and it gives me a usage error:
Code:
usage: $sock->recv(BUF, LEN [, FLAGS]) at status.pl line 18