HandShake.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using SuperSocket.SocketBase.Command;
  6. using SuperWebSocket.Protocol;
  7. namespace SuperWebSocket.Command
  8. {
  9. /// <summary>
  10. /// The command handle handshake request
  11. /// </summary>
  12. /// <typeparam name="TWebSocketSession">The type of the web socket session.</typeparam>
  13. class HandShake<TWebSocketSession> : CommandBase<TWebSocketSession, IWebSocketFragment>
  14. where TWebSocketSession : WebSocketSession<TWebSocketSession>, new()
  15. {
  16. /// <summary>
  17. /// Gets the name.
  18. /// </summary>
  19. public override string Name
  20. {
  21. get
  22. {
  23. return OpCode.HandshakeTag;
  24. }
  25. }
  26. /// <summary>
  27. /// Executes the command.
  28. /// </summary>
  29. /// <param name="session">The session.</param>
  30. /// <param name="requestInfo">The request info.</param>
  31. public override void ExecuteCommand(TWebSocketSession session, IWebSocketFragment requestInfo)
  32. {
  33. session.OnHandshakeSuccess();
  34. }
  35. }
  36. }