1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-23 02:58:00 +01:00

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

View file

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