Interface ISsdpCommunicationsServer
Interface for a component that manages network communication (sending and receiving HTTPU messages) for the SSDP protocol.
Inherited Members
Namespace: Rssdp.Infrastructure
Assembly: cs.temp.dll.dll
Syntax
public interface ISsdpCommunicationsServer : IDisposable
Properties
DeviceNetworkType
Determines whether IPv4 or IPv5 sockets are used by this communications server.
Declaration
DeviceNetworkType DeviceNetworkType { get; }
Property Value
| Type | Description |
|---|---|
| DeviceNetworkType |
IsShared
Gets or sets a boolean value indicating whether or not this instance is shared amongst multiple SsdpDeviceLocatorBase and/or ISsdpDevicePublisher instances.
Declaration
bool IsShared { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
If true, disposing an instance of a SsdpDeviceLocatorBaseor a ISsdpDevicePublisher will not dispose this comms server instance. The calling code is responsible for managing the lifetime of the server.
UdpSendCount
The number of times the Udp message is sent. Any value less than 2 will result in one message being sent. SSDP spec recommends sending messages multiple times (not more than 3) to account for possible packet loss over UDP.
Declaration
int UdpSendCount { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
See Also
UdpSendDelay
The delay between repeating messages (as specified in UdpSendCount).
Declaration
TimeSpan UdpSendDelay { get; set; }
Property Value
| Type | Description |
|---|---|
| System.TimeSpan |
See Also
Methods
BeginListeningForBroadcasts()
Causes the server to begin listening for multicast messages, being SSDP search requests and notifications.
Declaration
void BeginListeningForBroadcasts()
SendMessage(Byte[], UdpEndPoint)
Sends a message to a particular address (uni or multicast) and port.
Declaration
void SendMessage(byte[] messageData, UdpEndPoint destination)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | messageData | A byte array containing the data to send. |
| UdpEndPoint | destination | A UdpEndPoint representing the destination address for the data. Can be either a multicast or unicast destination. |
StopListeningForBroadcasts()
Causes the server to stop listening for multicast messages, being SSDP search requests and notifications.
Declaration
void StopListeningForBroadcasts()
StopListeningForResponses()
Stops listening for search responses on the local, unicast socket.
Declaration
void StopListeningForResponses()
Events
RequestReceived
Raised when a HTTPU request message is received by a socket (unicast or multicast).
Declaration
event EventHandler<RequestReceivedEventArgs> RequestReceived
Event Type
| Type | Description |
|---|---|
| System.EventHandler<RequestReceivedEventArgs> |
ResponseReceived
Raised when an HTTPU response message is received by a socket (unicast or multicast).
Declaration
event EventHandler<ResponseReceivedEventArgs> ResponseReceived
Event Type
| Type | Description |
|---|---|
| System.EventHandler<ResponseReceivedEventArgs> |