connection.sendPacket(iqPacket);
IQ response = (IQ) collector.nextResult(SmackConfiguration.getPacketReplyTimeout());
collector.cancel();
if (response == null) {
throw new XMPPException("No response from server on status set.");
}
if (response.getError() != null) {
throw new XMPPException("Error . Cause: "+response.getError().getMessage());
} else if (response.getType() == IQ.Type.ERROR) {
System.out.println("could not create user....");
throw new XMPPException("Error . Cause: "+response.getError().getMessage());
}
if (response instanceof SessionCount) {
SessionCount sCount = (SessionCount) response;
System.out.println("number of sessions: "+sCount.getNumberOfSessions());
}