FrameData.cs 783 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. namespace XGame.Framework.Network
  3. {
  4. internal class FrameDataBytes : IFrameData
  5. {
  6. public byte[] bytes;
  7. public int offset;
  8. public int length;
  9. public void Clear()
  10. {
  11. SessionBufferPool.Recycle(bytes);
  12. bytes = null;
  13. offset = 0;
  14. length = 0;
  15. }
  16. }
  17. internal class FrameDataEvent : IFrameData
  18. {
  19. public ESessionCode code;
  20. public Exception exception;
  21. public void Clear()
  22. {
  23. code = ESessionCode.None;
  24. exception = null;
  25. }
  26. }
  27. internal class FrameDataMessage : IFrameData
  28. {
  29. public IMessage message;
  30. public void Clear()
  31. {
  32. message = null;
  33. }
  34. }
  35. }