aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Net/IAcceptSocket.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-03-08 02:24:52 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-03-08 02:24:52 -0500
commitd5c7845917bd15a945aacb92f50db6502123ad9a (patch)
treeb4f9ecfd2d716733ff04406d9360d084ec11cf18 /MediaBrowser.Model/Net/IAcceptSocket.cs
parentcf57e8193c5108804724dd55242a56e03b907ed7 (diff)
parent23010f2980381a4b56e05620d4604cafc0e00043 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/Emby
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 000000000..cac23b337
--- /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 Connect(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; }
+ }
+}