diff --git a/src/main/java/pe/pi/sctp4j/sctp/SCTPMessage.java b/src/main/java/pe/pi/sctp4j/sctp/SCTPMessage.java index e96d4fe..063e213 100644 --- a/src/main/java/pe/pi/sctp4j/sctp/SCTPMessage.java +++ b/src/main/java/pe/pi/sctp4j/sctp/SCTPMessage.java @@ -199,6 +199,8 @@ private void dcepMessageDeal(byte[] data) { } } catch (Exception x) { Log.error("Problem with DCOpen " + x.getMessage()); + if (Log.getLevel() >= Log.DEBUG) {x.printStackTrace();} + } } diff --git a/src/main/java/pe/pi/sctp4j/sctp/SCTPStream.java b/src/main/java/pe/pi/sctp4j/sctp/SCTPStream.java index 4769b24..ce998d6 100644 --- a/src/main/java/pe/pi/sctp4j/sctp/SCTPStream.java +++ b/src/main/java/pe/pi/sctp4j/sctp/SCTPStream.java @@ -73,6 +73,7 @@ public SCTPStreamListener getSCTPStreamListener() { return _sl; } + @Override public String toString() { return this.getClass().getSimpleName() + "[" + this._sno + "]" @@ -132,7 +133,7 @@ public void setLabel(String l) { } public Integer getNum() { - return new Integer(_sno); + return _sno; } public Chunk[] append(DataChunk dc) { @@ -158,7 +159,7 @@ public void setBehave(SCTPStreamBehaviour behave) { * @param chunk */ public void outbound(DataChunk chunk) { - chunk.setStreamId(_sno.intValue()); + chunk.setStreamId(_sno); // roll seqno here.... hopefully.... } diff --git a/src/main/java/pe/pi/sctp4j/sctp/dataChannel/DECP/DCOpen.java b/src/main/java/pe/pi/sctp4j/sctp/dataChannel/DECP/DCOpen.java index 542e22c..0cf5bd7 100644 --- a/src/main/java/pe/pi/sctp4j/sctp/dataChannel/DECP/DCOpen.java +++ b/src/main/java/pe/pi/sctp4j/sctp/dataChannel/DECP/DCOpen.java @@ -184,7 +184,8 @@ public boolean isAck() { } public SCTPStreamBehaviour mkStreamBehaviour() { - Log.debug("Making a behaviour for dcep stream " + new String(_label)); + String loglab = _label == null?"_null_":new String(_label); + Log.debug("Making a behaviour for dcep stream " + loglab); SCTPStreamBehaviour behave = null; switch (_chanType) { case RELIABLE: @@ -205,7 +206,7 @@ public SCTPStreamBehaviour mkStreamBehaviour() { break; } if (behave != null) { - Log.debug(new String(_label) + " behaviour is " + behave.getClass().getSimpleName()); + Log.debug(loglab + " behaviour is " + behave.getClass().getSimpleName()); } return behave;