IAcceptSocket.cs 728 B

123456789101112131415161718192021222324252627
  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. }
  15. public class SocketCreateException : Exception
  16. {
  17. public SocketCreateException(string errorCode, Exception originalException)
  18. : base(errorCode, originalException)
  19. {
  20. ErrorCode = errorCode;
  21. }
  22. public string ErrorCode { get; private set; }
  23. }
  24. }