drewhead has asked for the wisdom of the Perl Monks concerning the following question:
I am considering doing this through a socket with IO:Socket. From the Net::IRC documentation I think I should be able so simply create my socket
pass it to the addfh method (after creating my $irc object of course)my $server = IO::Socket::INET->new( LocalPort => $listen_port, Blocking => 0, Listen => 5 ) or croak $@;
And then have &from_socket invoked everytime some data is written to the socket from my third parties' client connection (which likely will hold the socket open for weeks writing 20-40 times per day).$irc->addfh($server, \&from_socket, "r" );
My problem is that I don't know what &from_socket should look like and have been unable to find any example code in the src, goole, SuperSearch. I've played with this off and on for a week and tried so many things I'm coding in circles now. I either seem to block or be unable to retrieve the data from the client.
Does anyone use addfh and have example code that they would be willing to share? Am I barking up the wrong tree and need to investigate another suggested plan of attack? Thanks Monks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using addfh in Net::IRC with a socket (use POE instead)
by grinder (Bishop) on Oct 07, 2003 at 20:51 UTC |