IConnectionFilter.cs 996 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Specialized;
  3. using System.Configuration.Provider;
  4. using System.Net;
  5. using SuperSocket.SocketBase.Config;
  6. namespace SuperSocket.SocketBase
  7. {
  8. /// <summary>
  9. /// The basic interface of connection filter
  10. /// </summary>
  11. public interface IConnectionFilter
  12. {
  13. /// <summary>
  14. /// Initializes the connection filter
  15. /// </summary>
  16. /// <param name="name">The name.</param>
  17. /// <param name="appServer">The app server.</param>
  18. /// <returns></returns>
  19. bool Initialize(string name, IAppServer appServer);
  20. /// <summary>
  21. /// Gets the name of the filter.
  22. /// </summary>
  23. string Name { get; }
  24. /// <summary>
  25. /// Whether allows the connect according the remote endpoint
  26. /// </summary>
  27. /// <param name="remoteAddress">The remote address.</param>
  28. /// <returns></returns>
  29. bool AllowConnect(IPEndPoint remoteAddress);
  30. }
  31. }