aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Net/IAcceptSocket.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-03-02 15:50:09 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-03-02 15:50:09 -0500
commit9776ca09db59a1e382045a072813a29cf07cadb3 (patch)
treebea754fb9af1d076cdd20bdf5722fdc0d77ec27d /MediaBrowser.Model/Net/IAcceptSocket.cs
parent9f7ee6d34c7e5137c6740a2c3c428f60a4375ba9 (diff)
update socket interfaces
Diffstat (limited to 'MediaBrowser.Model/Net/IAcceptSocket.cs')
-rw-r--r--MediaBrowser.Model/Net/IAcceptSocket.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/MediaBrowser.Model/Net/IAcceptSocket.cs b/MediaBrowser.Model/Net/IAcceptSocket.cs
new file mode 100644
index 0000000000..0467129c01
--- /dev/null
+++ b/MediaBrowser.Model/Net/IAcceptSocket.cs
@@ -0,0 +1,28 @@
+using System;
+
+namespace MediaBrowser.Model.Net
+{
+ public interface IAcceptSocket : IDisposable
+ {
+ bool DualMode { get; }
+ IpEndPointInfo LocalEndPoint { get; }
+ IpEndPointInfo RemoteEndPoint { get; }
+ void Close();
+ void Shutdown(bool both);
+ void Listen(int backlog);
+ void Bind(IpEndPointInfo endpoint);
+
+ void StartAccept(Action<IAcceptSocket> onAccept, Func<bool> isClosed);
+ }
+
+ public class SocketCreateException : Exception
+ {
+ public SocketCreateException(string errorCode, Exception originalException)
+ : base(errorCode, originalException)
+ {
+ ErrorCode = errorCode;
+ }
+
+ public string ErrorCode { get; private set; }
+ }
+}