NmeaTcpServer Class

Definition

A TCP Server bidirectional sink and source. Provides NMEA sentences to each connected client.

public class NmeaTcpServer : Iot.Device.Nmea0183.NmeaSinkAndSource
type NmeaTcpServer = class
    inherit NmeaSinkAndSource
Public Class NmeaTcpServer
Inherits NmeaSinkAndSource
Inheritance
NmeaTcpServer

Remarks

Using this class in applications targeting .NET core 3.1 or earlier may cause deadlocks when closing the connection. It is recommended to target .NET 6.0 or above when using this class.

Constructors

NmeaTcpServer(String)

Creates a server with the given source name. The default network port is 10110.

NmeaTcpServer(String, IPAddress, Int32)

Creates a server with the given source name bound to the given local IP and port. This will not open the server yet. Use StartDecode() to open the network port.

Properties

InterfaceName

Name of the interface

(Inherited from NmeaSinkAndSource)

Methods

DispatchSentenceEvents(NmeaSentence)

Forwards the given sentence to listeners, as needed. Use the current instance as source.

(Inherited from NmeaSinkAndSource)
DispatchSentenceEvents(NmeaSinkAndSource, NmeaSentence)

Forwards the given sentence to listeners, as needed.

(Inherited from NmeaSinkAndSource)
Dispose()

Standard dispose method

(Inherited from NmeaSinkAndSource)
Dispose(Boolean)

Dispose this instance

(Inherited from NmeaSinkAndSource)
FireOnParserError(String, NmeaError)

Fire an event informing about parser errors

(Inherited from NmeaSinkAndSource)
SendSentence(NmeaSentence)

Send the given sentence to the interface.

(Inherited from NmeaSinkAndSource)
SendSentence(NmeaSinkAndSource, NmeaSentence)

Sends the sentence to all our clients. If it is needed to make distinctions for what needs to be sent to which client, create multiple server instances. This will allow for proper filtering.

SendSentences(IEnumerable<NmeaSentence>)

Sends a list of messages at once

(Inherited from NmeaSinkAndSource)
StartDecode()

Starts a network server with the settings provided by the constructor.

StopDecode()

Stops sending or receiving messages from and to this interface. Any pending messages are discarded.

Events

OnNewPosition

This is fired when a new position is available

(Inherited from NmeaSinkAndSource)
OnNewSequence

This is fired on every new sentence

(Inherited from NmeaSinkAndSource)
OnNewTime

This is fired when the time is updated

(Inherited from NmeaSinkAndSource)
OnParserError

This is fired when a message couldn't be parsed

(Inherited from NmeaSinkAndSource)

Applies to