PircBot Java IRC Bot

org.jibble.pircbot
Class DccChat

java.lang.Object
  |
  +--org.jibble.pircbot.DccChat

public class DccChat
extends Object

This class is used to allow the bot to interact with a DCC Chat session.

Version:
1.0.0 (Build time: Fri Jan 3 22:26:30 2003)
Author:
Paul James Mutton, http://www.jibble.org/

Constructor Summary
protected DccChat(PircBot bot, String sourceNick, Socket socket)
          This constructor is used after we have issued a DCC CHAT request to somebody.
protected DccChat(PircBot bot, String sourceNick, String address, int port)
          This constructor is used when we are accepting a DCC CHAT request from somebody.
 
Method Summary
 void close()
          Closes the DCC Chat connection.
 String readLine()
          Reads the next line of text from the client at the other end of our DCC Chat connection.
 void sendLine(String line)
          Sends a line of text to the client at the other end of our DCC Chat connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DccChat

protected DccChat(PircBot bot,
                  String sourceNick,
                  String address,
                  int port)
           throws IOException
This constructor is used when we are accepting a DCC CHAT request from somebody. It attempts to connect to the client that issued the request.


DccChat

protected DccChat(PircBot bot,
                  String sourceNick,
                  Socket socket)
           throws IOException
This constructor is used after we have issued a DCC CHAT request to somebody. If the client accepts the chat request, then the socket we obtain is passed to this constructor.

Method Detail

readLine

public String readLine()
                throws IOException
Reads the next line of text from the client at the other end of our DCC Chat connection. This method blocks until something can be returned. If the connection has closed, null is returned.

Returns:
The next line of text from the client. Returns null if the connection has closed.
IOException

sendLine

public void sendLine(String line)
              throws IOException
Sends a line of text to the client at the other end of our DCC Chat connection.

Parameters:
line - The line of text to be sent. This should not include linefeed characters.
IOException

close

public void close()
           throws IOException
Closes the DCC Chat connection.

IOException

PircBot Java IRC Bot