MessagePackProtocol.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #if !BESTHTTP_DISABLE_SIGNALR_CORE
  2. using System;
  3. using System.Collections.Generic;
  4. using BestHTTP.SignalRCore.Messages;
  5. namespace BestHTTP.SignalRCore.Encoders
  6. {
  7. public sealed class MessagePackEncoder : BestHTTP.SignalRCore.IEncoder
  8. {
  9. public string Name { get { return "messagepack"; } }
  10. public object ConvertTo(Type toType, object obj)
  11. {
  12. throw new NotImplementedException();
  13. }
  14. public T DecodeAs<T>(string text)
  15. {
  16. throw new NotImplementedException();
  17. }
  18. public T DecodeAs<T>(byte[] data)
  19. {
  20. throw new NotImplementedException();
  21. }
  22. public byte[] EncodeAsBinary<T>(T value)
  23. {
  24. throw new NotImplementedException();
  25. }
  26. public string EncodeAsText<T>(T value)
  27. {
  28. throw new NotImplementedException();
  29. }
  30. }
  31. public sealed class MessagePackProtocol : BestHTTP.SignalRCore.IProtocol
  32. {
  33. public TransferModes Type { get { return TransferModes.Binary; } }
  34. public IEncoder Encoder { get; private set; }
  35. public HubConnection Connection { get; set; }
  36. public MessagePackProtocol()
  37. {
  38. this.Encoder = new MessagePackEncoder();
  39. }
  40. /// <summary>
  41. /// Convert a value to the given type.
  42. /// </summary>
  43. public object ConvertTo(Type toType, object obj)
  44. {
  45. throw new NotImplementedException();
  46. }
  47. /// <summary>
  48. /// This function must return the encoded representation of the given message.
  49. /// </summary>
  50. public byte[] EncodeMessage(Message message)
  51. {
  52. throw new NotImplementedException();
  53. }
  54. /// <summary>
  55. /// This function must convert all element in the arguments array to the corresponding type from the argTypes array.
  56. /// </summary>
  57. public object[] GetRealArguments(Type[] argTypes, object[] arguments)
  58. {
  59. throw new NotImplementedException();
  60. }
  61. /// <summary>
  62. /// This function must parse binary representation of the messages into the list of Messages.
  63. /// </summary>
  64. public void ParseMessages(string data, ref List<Message> messages)
  65. {
  66. throw new NotImplementedException();
  67. }
  68. /// <summary>
  69. /// This function must parse textual representation of the messages into the list of Messages.
  70. /// </summary>
  71. public void ParseMessages(byte[] data, ref List<Message> messages)
  72. {
  73. throw new NotImplementedException();
  74. }
  75. }
  76. }
  77. #endif