public void Send(byte[] buf, int off, int len) { var lenBuf = DCGameProtocol.GetUshortBuf((ushort)len); mSendBuf.Write(lenBuf, 0, lenBuf.Length); mSendBuf.Write(buf, off, len); StartSend(); }
public void Send(params SendBuf[] bufs) { if (bufs.Length == 0) { return; } var len = 0; foreach (var buf in bufs) { len += buf.len; } var lenBuf = DCGameProtocol.GetUshortBuf((ushort)len); mSendBuf.Write(lenBuf, 0, lenBuf.Length); foreach (var buf in bufs) { mSendBuf.Write(buf.buf, buf.off, buf.len); } StartSend(); }