internal override SCTPMessage makeMessage(string bytes, BlockingSCTPStream s) { SCTPMessage m = null; if (base.canSend()) { if (bytes.Length < this.maxMessageSize()) { m = new SCTPMessage(bytes, s); lock (s) { int mseq = s.getNextMessageSeqOut(); s.setNextMessageSeqOut(mseq + 1); m.setSeq(mseq); } } else { logger.LogWarning("Message too long " + bytes.Length + " > " + this.maxMessageSize()); } } else { logger.LogWarning("Can't send a message right now"); } return(m); }
internal override SCTPMessage makeMessage(byte[] bytes, BlockingSCTPStream s) { lock (this) { SCTPMessage m = null; if (base.canSend()) { if (bytes.Length < this.maxMessageSize()) { m = new SCTPMessage(bytes, s); lock (s) { int mseq = s.getNextMessageSeqOut(); s.setNextMessageSeqOut(mseq + 1); m.setSeq(mseq); } } } return(m); } }