diff --git a/src/org/jitsi/impl/neomedia/RTPConnectorOutputStream.java b/src/org/jitsi/impl/neomedia/RTPConnectorOutputStream.java index 96fd8b3b1bda2bc2937ce9b214ba239753ab9f8f..078c3992e9eb5e844b94d5d77cb5f3cf55bcf541 100755 --- a/src/org/jitsi/impl/neomedia/RTPConnectorOutputStream.java +++ b/src/org/jitsi/impl/neomedia/RTPConnectorOutputStream.java @@ -272,7 +272,10 @@ protected abstract void doLogPacket( private boolean send(RawPacket packet) { if(!isSocketValid()) + { + rawPacketPool.offer(packet); return false; + } numberOfPackets++; for (InetSocketAddress target : targets) @@ -377,6 +380,7 @@ public int write(byte[] buffer, int offset, int length) { //skip sending the rest, but return them to the pool fail = true; + continue; } } else @@ -385,7 +389,7 @@ public int write(byte[] buffer, int offset, int length) } } - if (pkt != null) + if (pkt != null && fail) //if !fail, send() will have returned it rawPacketPool.offer(pkt); }