These two messages are the minimum that should be sent to an IRC server to log on. It then logs out of the server and ends. Pretty much all communications in IRC are routed through the server. A game of ping pong To ensure that clients are still connected, an IRC server will periodically send them a ping message. This timeout value is a server-specific setting.
Typical values are around a minute or so.
Ping handling occurs in the private pingpong method, which returns true if the server message was a ping and prints ping pong to System.out . Leave the bot idle and connected and watch its console output to see how often a server sends ping messages. The service method checks for this specific command string. If the message isn't a privmsg , the method sleeps for a tenth of a second and returns. The meaning of the prefix portion of a message depends on the command.