mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Make sendPacket throw NotConnectedException
also use XMPPConnection.sendPacket() instead of PacketWriter.sendPacket() in XMPPTCPConnection.
This commit is contained in:
parent
7041e90522
commit
42f2eae8fb
5 changed files with 40 additions and 31 deletions
|
@ -336,14 +336,15 @@ public class XMPPBOSHConnection extends XMPPConnection {
|
|||
callConnectionAuthenticatedListener();
|
||||
}
|
||||
|
||||
void sendPacketInternal(Packet packet) {
|
||||
if (!done) {
|
||||
try {
|
||||
send(ComposableBody.builder().setPayloadXML(packet.toXML().toString())
|
||||
.build());
|
||||
} catch (BOSHException e) {
|
||||
LOGGER.log(Level.SEVERE, "BOSHException in sendPacketInternal", e);
|
||||
}
|
||||
void sendPacketInternal(Packet packet) throws NotConnectedException {
|
||||
if (done) {
|
||||
throw new NotConnectedException();
|
||||
}
|
||||
try {
|
||||
send(ComposableBody.builder().setPayloadXML(packet.toXML().toString()).build());
|
||||
}
|
||||
catch (BOSHException e) {
|
||||
LOGGER.log(Level.SEVERE, "BOSHException in sendPacketInternal", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue