SMACK-339 Allow ConnectionListeners to be added before Connection is connected

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/branches/smack_3_3_2@13798 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Florian Schmaus 2013-11-02 11:46:21 +00:00 committed by flow
parent 418dd24392
commit 84e1f32284
1 changed files with 1 additions and 5 deletions

View File

@ -527,15 +527,11 @@ public abstract class Connection {
/**
* Adds a connection listener to this connection that will be notified when
* the connection closes or fails. The connection needs to already be connected
* or otherwise an IllegalStateException will be thrown.
* the connection closes or fails.
*
* @param connectionListener a connection listener.
*/
public void addConnectionListener(ConnectionListener connectionListener) {
if (!isConnected()) {
throw new IllegalStateException("Not connected to server.");
}
if (connectionListener == null) {
return;
}