public void OnTransportWrite(ITcpSession session, ref WrappedWriter writer, WrappedArgs args) { var buffer = args.Value as byte[]; writer.Write(buffer); writer.Write(this.symbol); }
public void OnTransportWrite(IUdpSession session, ref WrappedWriter writer, WrappedArgs args) { byte[] bytes = args.Value as byte[]; if (bytes != null) { writer.Write(bytes.Length); writer.Write(bytes); } }
public void OnTransportWrite(ITcpSession session, ref WrappedWriter writer, WrappedArgs args) { var buffer = args.Value as byte[]; if (buffer.Length > this.maxPackLength) { throw new Exception("pack length error!!!" + buffer.Length); } writer.Write((int)buffer.Length); writer.Write(buffer); }
public void OnTransportWrite(IUdpSession session, ref WrappedWriter writer, WrappedArgs args) { //Console.WriteLine($"{nameof(UdpFilter_2)}.{nameof(OnTransportWrite)}"); var buffer = args.Value as byte[]; writer.Write(buffer); }
public override void OnUdpMessageOutput(IUdpSession session, ref WrappedWriter writer, WrappedArgs args) { IWrappedMemory memory = args.Value as IWrappedMemory; if (memory.Flag == MemoryFlag.Kcp) { //kcp协议 writer.Write(k_message); } else if (memory.Flag == MemoryFlag.Udp) { //普通udp协议 writer.Write(c_message); } writer.Write(memory.GetReadableMemory()); }
public void OnTransportWrite(IKcpSession session, ref WrappedWriter writer, WrappedArgs args) { byte[] bytes = args.Value as byte[]; //Console.WriteLine("kcp pipeline写入数据>>" + bytes.Length); writer.Write(bytes); }