WebSocketProtocol.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using SuperSocket.SocketBase;
  6. using SuperSocket.SocketBase.Command;
  7. using SuperSocket.SocketBase.Protocol;
  8. using SuperWebSocket.Protocol;
  9. using SuperWebSocket.SubProtocol;
  10. namespace SuperWebSocket
  11. {
  12. /// <summary>
  13. /// WebSocket protocol
  14. /// </summary>
  15. public class WebSocketProtocol : IReceiveFilterFactory<IWebSocketFragment>
  16. {
  17. /// <summary>
  18. /// Initializes a new instance of the <see cref="WebSocketProtocol"/> class.
  19. /// </summary>
  20. public WebSocketProtocol()
  21. {
  22. }
  23. /// <summary>
  24. /// Creates the filter.
  25. /// </summary>
  26. /// <param name="appServer">The app server.</param>
  27. /// <param name="appSession">The app session.</param>
  28. /// <param name="remoteEndPoint">The remote end point.</param>
  29. /// <returns></returns>
  30. public IReceiveFilter<IWebSocketFragment> CreateFilter(IAppServer appServer, IAppSession appSession, System.Net.IPEndPoint remoteEndPoint)
  31. {
  32. return new WebSocketHeaderReceiveFilter((IWebSocketSession)appSession);
  33. }
  34. }
  35. }