IAcceptSocket.cs 807 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. namespace MediaBrowser.Model.Net
  3. {
  4. public interface IAcceptSocket : IDisposable
  5. {
  6. bool DualMode { get; }
  7. IpEndPointInfo LocalEndPoint { get; }
  8. IpEndPointInfo RemoteEndPoint { get; }
  9. void Close();
  10. void Shutdown(bool both);
  11. void Listen(int backlog);
  12. void Bind(IpEndPointInfo endpoint);
  13. void Connect(IpEndPointInfo endPoint);
  14. void StartAccept(Action<IAcceptSocket> onAccept, Func<bool> isClosed);
  15. }
  16. public class SocketCreateException : Exception
  17. {
  18. public SocketCreateException(string errorCode, Exception originalException)
  19. : base(errorCode, originalException)
  20. {
  21. ErrorCode = errorCode;
  22. }
  23. public string ErrorCode { get; private set; }
  24. }
  25. }