private async Task CopyToAsync(IProxyServerUdpAssociateHandler src, IProxyServerUdpAssociateHandler dst) { try { byte[] buffer = new byte[64 * 1024]; while (true) { UdpReceiveFromResult result = await src.ReceiveFromAsync(buffer, 0, buffer.Length); await dst.SendToAsync(buffer, 0, result.BytesReceived, result.RemoteEndPoint); } } finally { Dispose(); } }
private async Task CopyToAsync(IProxyServerUdpAssociateHandler src, IProxyServerUdpAssociateHandler dst) { try { byte[] buffer = new byte[64 * 1024]; while (true) { SocketReceiveFromResult result = await src.ReceiveFromAsync(buffer); await dst.SendToAsync(new ArraySegment <byte>(buffer, 0, result.ReceivedBytes), result.RemoteEndPoint); } } finally { Dispose(); } }