I try to use SmartIRC to paste a message in a channel and then quit. But this won't work as requested.
I Use following Code:
$irc =& new Net_SmartIRC();
$irc->connect( 'testserver' '6667');
$irc->login( 'test, 'Test User' );
$irc->join( array("#irc-test" );
$irc->setChannelSyncing(TRUE);
$irc->message(SMARTIRC_TYPE_CHANNEL, "#irc-test", "say hello");
$irc->listenFor(SMARTIRC_TYPE_CHANNEL);
$irc->disconnect();
This work but listenFor() wait for the next message to apear in the channel. If I use SMARTIRC_TYPE_JOIN then nothing will appear on the channel and the client disconnect clear.
What can I improve to or change that only the message will be send and then rapidly quit, becaause my site hung until the IRC Client has not disconnect?
Thx in forward.
Cheers
-Peter
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I try to use SmartIRC to paste a message in a channel and then quit. But this won't work as requested.
I Use following Code:
$irc =& new Net_SmartIRC();
$irc->connect( 'testserver' '6667');
$irc->login( 'test, 'Test User' );
$irc->join( array("#irc-test" );
$irc->setChannelSyncing(TRUE);
$irc->message(SMARTIRC_TYPE_CHANNEL, "#irc-test", "say hello");
$irc->listenFor(SMARTIRC_TYPE_CHANNEL);
$irc->disconnect();
This work but listenFor() wait for the next message to apear in the channel. If I use SMARTIRC_TYPE_JOIN then nothing will appear on the channel and the client disconnect clear.
What can I improve to or change that only the message will be send and then rapidly quit, becaause my site hung until the IRC Client has not disconnect?
Thx in forward.
Cheers
-Peter
Perhaps $irc->quit()
$irc =& new Net_SmartIRC();
$irc->connect( 'testserver' '6667');
$irc->login( 'test, 'Test User' );
$irc->join( array("#irc-test" );
$irc->setChannelSyncing(TRUE);
$irc->message(SMARTIRC_TYPE_CHANNEL, "#irc-test", "say hello");
$irc->quit();
//$irc->listenFor(SMARTIRC_TYPE_CHANNEL);
$irc->disconnect();
No this doesn't solve my problem.
The quit closes the connection but nothing will appear on the channel.
Any other suggestions?