jellyfin/MediaBrowser.Model/Net/ISocket.cs

29 lines
749 B
C#
Raw Normal View History

2016-11-08 11:44:23 -07:00
using System;
namespace MediaBrowser.Model.Net
{
public interface ISocket : IDisposable
{
2016-12-07 13:02:34 -07:00
bool DualMode { get; }
2016-11-08 11:44:23 -07: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 13:02:34 -07: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 11:44:23 -07:00
}