You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

IProtocolMessage.cs 572 B

123456789101112131415161718
  1. using System;
  2. namespace Shadowsocks.Protocol
  3. {
  4. public interface IProtocolMessage : IEquatable<IProtocolMessage>
  5. {
  6. public int Serialize(Memory<byte> buffer);
  7. /// <summary>
  8. ///
  9. /// </summary>
  10. /// <param name="buffer"></param>
  11. /// <returns>Tuple represent load state,
  12. /// when success, length is how many byte has been taken
  13. /// when fail, length is how many byte required, 0 is parse error
  14. /// </returns>
  15. public (bool success, int length) TryLoad(ReadOnlyMemory<byte> buffer);
  16. }
  17. }