CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
IO::Socket

 



Rivotti
User

Sep 17, 2002, 7:29 AM

Post #1 of 2 (1414 views)
IO::Socket Can't Post

Hi all,

I'm triyng to make a rcon script to listen to a mohaa server. I'm usign IO::Socket and I know how to set up a connection to the server:

use IO::socket;

my $sock = IO::Socket::INET->new(
Proto => 'udp',
PeerAddr => 'xxx.xxx.xxx.xxx',
PeerPort => '12203'
) or die "socket: $@";

Ok, I thing i'm doing everything correct here but, how i listen to whatever is happening in the server? I've tryed:

while ( <$sock> ) {
print;
}

... but nothing happens. Does anyone know how to do this? And, by the way, how to set events in case something happen? E.g: on "CHAT: NICK HELLO" do &do_chat()

Please I'm getting dizzy with this. I've tryed several things in the past days and don't seem to be getting any thing.

Thanks in advance for preservind my mental health :)
Rivotti
André Rivotti Casimiro
Web Designer/Programmer
MyGamesPlayer.com
http://www.mygamesplayer.com

(This post was edited by Rivotti on Sep 17, 2002, 7:30 AM)


entius
stranger

Sep 18, 2002, 7:12 AM

Post #2 of 2 (1400 views)
Re: [Rivotti] IO::Socket [In reply to] Can't Post

read the post i've make with the same subject, there there is some code you will find useful!

well, i write here anyway:
print $data while read($socket,$data,1024) > 0;
blogum

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives