Click or drag to resize

UdpDiscoverClientBroadcastAsync Method

Sends a broadcast message that discover responders can receive and respond to to annouce their presence in the network.

Namespace: Orthogonal.MixedCommsLib
Assembly: Orthogonal.MixedCommsLib (in Orthogonal.MixedCommsLib.dll) Version: 2.0.3
Syntax
C#
public Task<string[]> BroadcastAsync(
	string message,
	int timeoutMilliseconds = 1000
)

Parameters

message  String
The broadcast message string. The format of the message is user defined and forms a contract between the discover client and responder. It may be a simple string of text or a fragment of JSON or XML that carries more complex information.
timeoutMilliseconds  Int32  (Optional)
The number of milliseconds to wait for all discover responders to respond. The default is 1000 (1 second). Clients can adjust the timeout to suit their performance expectations based upon the responsiveness of their network and client performance requirements.

Return Value

TaskString
A non-null string array, each element containing a response from a discover server. The format of the response forms a contract between the client and responder. It may be a simple string of text or a fragment of JSON or XML that carries more complex information.
Remarks
It was found that the UdpClient class must be recreated for each broadacast, otherwise only the first responder response is received. The reason for this is unclear.
See Also