public ReliableMessageChannel() { config = ReliableConfig.DefaultConfig(); config.TransmitPacketCallback = (buffer, size) => { TransmitCallback(buffer, size); }; config.ProcessPacketCallback = processPacket; config.AckPacketCallback = ackPacket; sendBuffer = new SequenceBuffer <BufferedPacket>(256); receiveBuffer = new SequenceBuffer <BufferedPacket>(256); ackBuffer = new SequenceBuffer <OutgoingPacketSet>(256); time = DateTime.Now.GetTotalSeconds(); lastBufferFlush = -1.0; lastMessageSend = 0.0; this.packetController = new ReliablePacketController(config, time); this.congestionDisableInterval = 5.0; this.sequence = 0; this.nextReceive = 0; this.oldestUnacked = 0; }
public UnreliableOrderedMessageChannel() { config = ReliableConfig.DefaultConfig(); config.TransmitPacketCallback = (buffer, size) => { TransmitCallback(buffer, size); }; config.ProcessPacketCallback = processPacket; packetController = new ReliablePacketController(config, DateTime.Now.GetTotalSeconds()); }
public UnreliableMessageChannel() { receiveBuffer = new SequenceBuffer <ReceivedPacketData>(256); config = ReliableConfig.DefaultConfig(); config.TransmitPacketCallback = delegate(byte[] buffer, int size) { TransmitCallback(buffer, size); }; config.ProcessPacketCallback = delegate(ushort seq, byte[] buffer, int size) { if (!receiveBuffer.Exists(seq)) { receiveBuffer.Insert(seq); ReceiveCallback(ChannelID, buffer, size); } }; packetController = new ReliablePacketController(config, DateTime.Now.GetTotalSeconds()); }