aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common/Net/IUdpServer.cs
blob: 036977eab5716b0c6717dec18dcbf1440f9e5bfd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Threading.Tasks;

namespace MediaBrowser.Common.Net
{
    /// <summary>
    /// Interface IUdpServer
    /// </summary>
    public interface IUdpServer : IDisposable
    {
        /// <summary>
        /// Occurs when [message received].
        /// </summary>
        event EventHandler<UdpMessageReceivedEventArgs> MessageReceived;

        /// <summary>
        /// Starts the specified port.
        /// </summary>
        /// <param name="port">The port.</param>
        void Start(int port);

        /// <summary>
        /// Stops this instance.
        /// </summary>
        void Stop();

        /// <summary>
        /// Sends the async.
        /// </summary>
        /// <param name="bytes">The bytes.</param>
        /// <param name="remoteEndPoint">The remote end point.</param>
        /// <returns>Task.</returns>
        /// <exception cref="System.ArgumentNullException">data</exception>
        Task SendAsync(byte[] bytes, string remoteEndPoint);

        /// <summary>
        /// Sends the async.
        /// </summary>
        /// <param name="bytes">The bytes.</param>
        /// <param name="ipAddress">The ip address.</param>
        /// <param name="port">The port.</param>
        /// <returns>Task.</returns>
        /// <exception cref="System.ArgumentNullException">bytes</exception>
        Task SendAsync(byte[] bytes, string ipAddress, int port);
    }
}