[Cherbot-commit] SF.net SVN: cherbot: [82] trunk/src/net/sf/cherbot/IRCConnection.java
Status: Alpha
Brought to you by:
christianhujer
|
From: <chr...@us...> - 2007-06-18 21:18:56
|
Revision: 82
http://svn.sourceforge.net/cherbot/?rev=82&view=rev
Author: christianhujer
Date: 2007-06-18 14:18:51 -0700 (Mon, 18 Jun 2007)
Log Message:
-----------
Added IRC PING/PONG.
Modified Paths:
--------------
trunk/src/net/sf/cherbot/IRCConnection.java
Modified: trunk/src/net/sf/cherbot/IRCConnection.java
===================================================================
--- trunk/src/net/sf/cherbot/IRCConnection.java 2007-06-17 20:46:29 UTC (rev 81)
+++ trunk/src/net/sf/cherbot/IRCConnection.java 2007-06-18 21:18:51 UTC (rev 82)
@@ -24,6 +24,7 @@
/** An IRCConnection represents a connection to an IRC server.
* @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ * @see <a href="ftp://ftp.rfc-editor.org/in-notes/rfc2812.txt">RFC 2812: Internet Relay Chat: Client Protocol</a>
*/
public class IRCConnection extends AbstractConnection {
@@ -137,6 +138,18 @@
System.out.println(channel);
}
+ /** Processes a PING irc message.
+ * @param server Server that requests a PONG.
+ */
+ @Patterns({"^PING :(.*)$"})
+ public void processPING(@NotNull final String server) {
+ final PrintWriter out = this.out;
+ if (out != null) {
+ out.println("PONG " + server);
+ out.flush();
+ }
+ }
+
/** Joins an IRC channel.
* @param rawChannelName name of the channel to join.
* @return The channel that was just joined.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|