|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.relayirc.core.IRCConnection
A socket connection to a RFC-1459 compatible IRC server. Parses incoming IRC messages, replies, commands and errors and notifies all listeners of such. Also provides a writeln() method for sending commands to the IRC server.
FIX: Currently, only one listener is allowed.
The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
Original Code: Relay IRC Chat ServerIRCConnectionListener
,
IRCConnectionAdapter
,
IdentServer
Field Summary | |
static int |
CONNECTED
|
static int |
CONNECTING
|
static int |
DISCONNECTED
|
static int |
DISCONNECTING
|
Constructor Summary | |
IRCConnection(java.lang.String server,
int port,
java.lang.String nick,
java.lang.String altNick,
java.lang.String userName,
java.lang.String fullName)
Constructs, but does not open, an IRC connection by specifying server hostname and port of a IRC server as well as user registration information. |
Method Summary | |
void |
close()
Close socket connection to IRC server and close down message loop thread. |
java.lang.String |
getNick()
Get nick name currently in use. |
int |
getState()
Get engine's state (see ChatEngine.DISCONNECTED, ChatEngine.CONNECTED, etc. |
void |
open()
Opens socket connection to IRC server. |
void |
open(IRCConnection previousConnection)
Opens socket connection to IRC server. |
void |
run()
The main message loop. |
void |
sendNick(java.lang.String nick)
Send change-nickname request to IRC server and save value as the nick name currently in use. |
void |
setIRCConnectionListener(IRCConnectionListener listener)
For now, only one listener is supported. |
void |
setState(int state)
Set engine's state (see ChatEngine.DISCONNECTED, ChatEngine.CONNECTED, etc. |
void |
writeln(java.lang.String message)
Write directly to the IRC chat server, refer to RFC-1459 for valid commands. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int CONNECTED
public static final int CONNECTING
public static final int DISCONNECTED
public static final int DISCONNECTING
Constructor Detail |
public IRCConnection(java.lang.String server, int port, java.lang.String nick, java.lang.String altNick, java.lang.String userName, java.lang.String fullName)
server
- DNS-resolvable hostname of server.port
- Server port number to connect to.nick
- User's IRC nick name (e.g. Mortz).userName
- User's login/user name (e.g. mps).fullName
- User's full name (e.g. Mortimer P. Snerd)Method Detail |
public int getState()
public void setState(int state)
public void open()
public void open(IRCConnection previousConnection)
public void close()
public void setIRCConnectionListener(IRCConnectionListener listener)
public java.lang.String getNick()
public void sendNick(java.lang.String nick)
public void writeln(java.lang.String message)
public void run()
run
in interface java.lang.Runnable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |