mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-12-22 18:48: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:
parent
418dd24392
commit
84e1f32284
1 changed files with 1 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue