Hiya, not really sure if this should be in beginners or not, but I am a beginner :).

I'm trying to write a script (or currently using some other stuff to test) to send a 
network query out, querying game servers....


#!/usr/bin/perl -w

use Socket;
my $serverip = "194.109.69.91";
my $serverport = 27960;
my $getstatus = "\xFF\xFF\xFF\xFFgetstatus";  //THIS IS THE LINE I'M HAVING PROBLEMS 
WITH IN LINUX BEING SENT

$ipaddr = sockaddr_in($serverport, inet_aton($serverip));
$protocol = getprotobyname("udp");

socket(SOCKET, PF_INET, SOCK_DGRAM, $protocol) or die "socket: $!";
connect(SOCKET, $ipaddr) or die "connect: $!";
send(SOCKET, "$getstatus\n", 0);
recv(SOCKET, $response, 65000,0);
print ($response);

The weird thing is this works fine in windows and get a response i want, and if I 
packet stuff whats sent out (from $getstatus) the first part is FF FF FF FF which is 
fine, problem is under Linux when I run the script and sniff the packets going out it 
comes as c3 bf c3 bf c3 bf c3 bf. So somehow its not converting what I've entered 
correctly? Must be something obvious I'm missing?

Is there something odd I'm not realising with the perl installs on Linux compared to 
Windoze as the same script acts different.

Any help much appreciated...

tia fark





---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 23/09/2003

Reply via email to