Class CadIfWebSocketClient
This class implements the client side of the NG9-1-1 Emergency Incident Data Object (EIDO) transport protocol specified in the document entitled "NENA Standard for the Conveyance of Emergency Incident Data Objects (EIDOs) between Next Generation (NG9-1-1) Systems and Applications", NENA-STA-024.1a-2023.
The transport protocol between the client and the EIDO server uses WEB sockets. The client subscribes to the server and the server sends notification message containing one or more EIDOs to the client when they become available.
When the client receives an EIDO from the server, it fires an event containing the EIDO to the application or component using this class.
Inherited Members
Namespace: Ng911CadIfLib
Assembly: Ng911CadIfLib.dll
Syntax
public class CadIfWebSocketClient
Constructors
| Edit this page View SourceCadIfWebSocketClient(X509Certificate2, RemoteCertificateValidationCallback, string, int)
Constructor
Declaration
public CadIfWebSocketClient(X509Certificate2 clientCertificate, RemoteCertificateValidationCallback validationCallback, string strUri, int expiresSeconds)
Parameters
Type | Name | Description |
---|---|---|
X509Certificate2 | clientCertificate | X.509 certificate for this client if the server is using secure WEB sockets (WSS) and if the server is known to authenticate clients (mutual authentication). This parameter may be null if the server is known to not authenticate clients. This parameter may be non-null even if not using WSS with mutual authentication. |
RemoteCertificateValidationCallback | validationCallback | This callback function is called by the .NET network libraries during the TLS handhake. The parameters include the server's X.509 certificate and other information so that the application can authenticate the server. If this method returns true then the connection will be allowed. If it returns false then the connection will be prevented. This parameter is optional. If it is null then this class will use a default validation callback that allows connection to any server. |
string | strUri | WS or WSS URI of the server. For example: wss://192.168.1.84:16000/IncidentData/ent |
int | expiresSeconds | Specifies the expiration time of the subscription to the server in seconds. Must be greater than 20 seconds. |
Exceptions
Type | Condition |
---|---|
UriFormatException | This exception is thrown if the strUri parameter is not a valid URI. |
Methods
| Edit this page View SourceShutdown()
Call this method to end the subscription to the server and close the Web Socket connection to the server when the application is shutting down.
Declaration
public Task Shutdown()
Returns
Type | Description |
---|---|
Task | Returns an awaitable task. |
Start()
Initiates the connection to the EIDO server. Call this method after hooking the events.
Declaration
public void Start()
Events
| Edit this page View SourceCadIfConnectionState
This event is fired when the Web Socket connection to the server is established or lost.
Declaration
public event CadIfConnectionStateDelegate CadIfConnectionState
Event Type
Type | Description |
---|---|
CadIfConnectionStateDelegate | This delegate receives the current connection state of the Web Socket connection to the server and the URI of the server. |
CadIfSubscriptionState
This event is fired when the subscription to the server is established or terminated.
Declaration
public event CadIfSubscriptionStateDelegate CadIfSubscriptionState
Event Type
Type | Description |
---|---|
CadIfSubscriptionStateDelegate | This event receives the current subscription state and the URI of the server. |
EidoReceived
This event is fired when an EIDO is received from the server
Declaration
public event EidoReceivedDelegateType EidoReceived
Event Type
Type | Description |
---|---|
EidoReceivedDelegateType | This delegate receives an EidoType object and the URI of the EIDO server. |