mirror of
https://github.com/dotMorten/NmeaParser.git
synced 2026-01-20 23:50:18 +01:00
improve ntrip streaming
This commit is contained in:
parent
b699eab194
commit
f357b2423c
|
|
@ -60,13 +60,21 @@ namespace SampleApp.WinDesktop
|
|||
_ = Task.Run(async () =>
|
||||
{
|
||||
byte[] buffer = new byte[1024];
|
||||
int count = 0;
|
||||
while (true)
|
||||
{
|
||||
var count = await stream.ReadAsync(buffer);
|
||||
try
|
||||
{
|
||||
count = await stream.ReadAsync(buffer).ConfigureAwait(false);
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Debugger.Break();
|
||||
}
|
||||
var device = MainWindow.currentDevice;
|
||||
if (device != null && device.CanWrite)
|
||||
{
|
||||
await device.WriteAsync(buffer, 0, count);
|
||||
await device.WriteAsync(buffer, 0, count).ConfigureAwait(false);
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
ntripstatus.Text = $"Transmitted {ntripStream.Position} bytes";
|
||||
|
|
|
|||
Loading…
Reference in a new issue