org.jibble.pircbot
Class DccChat

java.lang.Object
  extended by org.jibble.pircbot.DccChat

public class DccChat
extends java.lang.Object

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

Since:
0.9c
Version:
1.5.0 (Build time: Mon Dec 14 20:07:17 2009)
Author:
Paul James Mutton, http://www.jibble.org/

Method Summary
 void accept()
          Accept this DccChat connection.
 void close()
          Closes the DCC Chat connection.
 java.io.BufferedReader getBufferedReader()
          Returns the BufferedReader used by this DCC Chat.
 java.io.BufferedWriter getBufferedWriter()
          Returns the BufferedReader used by this DCC Chat.
 java.lang.String getHostname()
          Returns the hostname of the DCC Chat initiator.
 java.lang.String getLogin()
          Returns the login of the DCC Chat initiator.
 java.lang.String getNick()
          Returns the nick of the other user taking part in this file transfer.
 long getNumericalAddress()
          Returns the address of the sender as a long.
 java.net.Socket getSocket()
          Returns the raw Socket used by this DCC Chat.
 java.lang.String readLine()
          Reads the next line of text from the client at the other end of our DCC Chat connection.
 void sendLine(java.lang.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
 

Method Detail

accept

public void accept()
            throws java.io.IOException
Accept this DccChat connection.

Throws:
java.io.IOException
Since:
1.2.0

readLine

public java.lang.String readLine()
                          throws java.io.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:
java.io.IOException - If an I/O error occurs.

sendLine

public void sendLine(java.lang.String line)
              throws java.io.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:
java.io.IOException - If an I/O error occurs.

close

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

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

getNick

public java.lang.String getNick()
Returns the nick of the other user taking part in this file transfer.

Returns:
the nick of the other user.

getLogin

public java.lang.String getLogin()
Returns the login of the DCC Chat initiator.

Returns:
the login of the DCC Chat initiator. null if we sent it.

getHostname

public java.lang.String getHostname()
Returns the hostname of the DCC Chat initiator.

Returns:
the hostname of the DCC Chat initiator. null if we sent it.

getBufferedReader

public java.io.BufferedReader getBufferedReader()
Returns the BufferedReader used by this DCC Chat.

Returns:
the BufferedReader used by this DCC Chat.

getBufferedWriter

public java.io.BufferedWriter getBufferedWriter()
Returns the BufferedReader used by this DCC Chat.

Returns:
the BufferedReader used by this DCC Chat.

getSocket

public java.net.Socket getSocket()
Returns the raw Socket used by this DCC Chat.

Returns:
the raw Socket used by this DCC Chat.

getNumericalAddress

public long getNumericalAddress()
Returns the address of the sender as a long.

Returns:
the address of the sender as a long.


PircBot Java IRC Bot.