private async void StartRecv() { while (u != null) { try { var recv = await u.ReceiveAsync().ConfigureAwait(false); tun?.PushPacket(recv.Buffer); } catch (ObjectDisposedException) { } catch (Exception ex) { DebugLogger.Log("Error receiving from packet processor: " + ex.ToString()); } } }
private void S_MessageReceived(DatagramSocket sender, DatagramSocketMessageReceivedEventArgs args) { var remotePort = args.RemotePort; var reader = args.GetDataReader(); byte[] b = new byte[reader.UnconsumedBufferLength]; reader.ReadBytes(b); tun.PushPacket(b); }
public void PushPacket(byte[] packet) { channel.LogDiagnosticMessage("Pushed one packet"); tun.PushPacket(packet); }