jellyfin/MediaBrowser.Model/Net/ISocket.cs

29 lines
749 B
C#
Raw Normal View History

2016-11-08 19:44:23 +01:00
using System;
namespace MediaBrowser.Model.Net
{
public interface ISocket : IDisposable
{
2016-12-07 21:02:34 +01:00
bool DualMode { get; }
2016-11-08 19:44:23 +01:00
IpEndPointInfo LocalEndPoint { get; }
IpEndPointInfo RemoteEndPoint { get; }
void Close();
void Shutdown(bool both);
void Listen(int backlog);
void Bind(IpEndPointInfo endpoint);
void StartAccept(Action<ISocket> onAccept, Func<bool> isClosed);
}
2016-12-07 21:02:34 +01:00
public class SocketCreateException : Exception
{
public SocketCreateException(string errorCode, Exception originalException)
: base(errorCode, originalException)
{
ErrorCode = errorCode;
}
public string ErrorCode { get; private set; }
}
2016-11-08 19:44:23 +01:00
}