diff options
| author | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-23 17:31:51 -0500 |
|---|---|---|
| committer | LukePulverenti <luke.pulverenti@gmail.com> | 2013-02-23 17:31:51 -0500 |
| commit | 2e4db7554041ecf481d3a38656fccc309e13eb5b (patch) | |
| tree | 73c064988db630f97edc18bbc3ea5fac9132483b /MediaBrowser.Common/Net/IUdpServer.cs | |
| parent | 1a423c43b4284848e155fc4a060ef7061b084ed8 (diff) | |
extracted http server, web socket server and udp server dependancies
Diffstat (limited to 'MediaBrowser.Common/Net/IUdpServer.cs')
| -rw-r--r-- | MediaBrowser.Common/Net/IUdpServer.cs | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/MediaBrowser.Common/Net/IUdpServer.cs b/MediaBrowser.Common/Net/IUdpServer.cs index 01a8ef021..036977eab 100644 --- a/MediaBrowser.Common/Net/IUdpServer.cs +++ b/MediaBrowser.Common/Net/IUdpServer.cs @@ -1,7 +1,46 @@ - +using System; +using System.Threading.Tasks; + namespace MediaBrowser.Common.Net { - public interface IUdpServer + /// <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); } } |
