Google

DccChat (PircBot 1.0.3 - Paul's Java IRC Bot Framework)
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.

Since:
0.9c
Version:
1.0.3 (Build time: Sat Jan 18 23:29:54 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.

Parameters:
bot - An instance of the underlying PircBot.
sourceNick - The nick of the sender.
address - The address to connect to.
port - The port number to connect to.
Throws:
IOException - If the connection cannot be made.

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.

Parameters:
bot - An instance of the underlying PircBot.
sourceNick - The nick of the user we are sending the request to.
socket - The socket which will be used for the DCC CHAT session.
Throws:
IOException - If the socket cannot be read from.
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 normally.
Throws:
IOException - If an I/O error occurs.

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.
Throws:
IOException - If an I/O error occurs.

close


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

Throws:
IOException - If an I/O error occurs.

PircBot Java IRC Bot