ares23
04-04-2008, 11:04 AM
Hey there,
We have a Bluehost web account which we're building a service on that requires UDP packets to be sent.
I put together the following test script to see if such a thing was possible:
#!/usr/bin/perl
print "Content-type: text/plain\n\n";
use IO::Socket;
$handle = IO::Socket::INET->new(Proto => 'udp') or die "socket: $@";
$PORTNO = 4767;
$HOSTNAME = "89.10.14.81";
$ipaddr = inet_aton($HOSTNAME);
$portaddr = sockaddr_in($PORTNO, $ipaddr);
$res = send($handle, "123thisisjustatest", 0, $portaddr) or print "cannot send: $!\n";
print "sent $res\n";
The script seems to run ok, but the send() operation fails with "Operation not permitted". I presume this is a security precaution (although the packet is sent on a port higher than 1024).
Does anyone know why this wouldn't work on Bluehost? Is this something we have to ask for permission to do, etc?
Thanks,
Ares.
We have a Bluehost web account which we're building a service on that requires UDP packets to be sent.
I put together the following test script to see if such a thing was possible:
#!/usr/bin/perl
print "Content-type: text/plain\n\n";
use IO::Socket;
$handle = IO::Socket::INET->new(Proto => 'udp') or die "socket: $@";
$PORTNO = 4767;
$HOSTNAME = "89.10.14.81";
$ipaddr = inet_aton($HOSTNAME);
$portaddr = sockaddr_in($PORTNO, $ipaddr);
$res = send($handle, "123thisisjustatest", 0, $portaddr) or print "cannot send: $!\n";
print "sent $res\n";
The script seems to run ok, but the send() operation fails with "Operation not permitted". I presume this is a security precaution (although the packet is sent on a port higher than 1024).
Does anyone know why this wouldn't work on Bluehost? Is this something we have to ask for permission to do, etc?
Thanks,
Ares.