diff --git a/pom.xml b/pom.xml index e3f6410..4d28fbf 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.ipseorama slice - 1.0.92-local + 1.1.0 jar @@ -27,7 +27,7 @@ junit junit - 4.12 + 4.13.1 test diff --git a/src/main/java/com/ipseorama/slice/SingleThreadNioIceEngine.java b/src/main/java/com/ipseorama/slice/SingleThreadNioIceEngine.java index 646e2eb..f07c4ad 100644 --- a/src/main/java/com/ipseorama/slice/SingleThreadNioIceEngine.java +++ b/src/main/java/com/ipseorama/slice/SingleThreadNioIceEngine.java @@ -331,10 +331,14 @@ private Long tx() { if (far != null) { Log.verb(StunPacket.hexString(sp.getTid()) + " sending packet type " + sp.getClass().getSimpleName() + " length " + o.length + " to " + far); ByteBuffer src = ByteBuffer.wrap(o); - if (ch.isConnected()) { - ch.write(src); + if (ch.isOpen()) { + if (ch.isConnected()) { + ch.write(src); + } else { + ch.send(src, far); + } } else { - ch.send(src, far); + Log.debug("chanel is closed "+ch); } } else { Log.verb("not sending packet to unresolved address"); diff --git a/src/main/java/com/ipseorama/slice/stun/IceStunBindingTransaction.java b/src/main/java/com/ipseorama/slice/stun/IceStunBindingTransaction.java index 3b870de..868aa57 100644 --- a/src/main/java/com/ipseorama/slice/stun/IceStunBindingTransaction.java +++ b/src/main/java/com/ipseorama/slice/stun/IceStunBindingTransaction.java @@ -106,7 +106,7 @@ public void receivedReply(StunPacket r) { if (this._far.equals(reflex)){ Log.debug("far ip confirmed as "+reflex); } else { - Log.info("new Ip found (peer reflexive) "+reflex+" on "+this.candidatePair); + Log.debug("new Ip found (peer reflexive) "+reflex+" on "+this.candidatePair); } if (oncomplete != null) { oncomplete.onEvent(this);