Structures.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. 
  2. namespace IFramework.Net
  3. {
  4. public class SegmentOffset
  5. {
  6. public byte[] buffer { get; set; }
  7. public int offset { get; set; }
  8. public int size { get; set; }
  9. public SegmentOffset()
  10. {
  11. }
  12. public SegmentOffset(byte[] buffer)
  13. {
  14. this.buffer = buffer;
  15. this.size = buffer.Length;
  16. }
  17. public SegmentOffset(byte[] buffer, int offset, int size)
  18. {
  19. this.buffer = buffer;
  20. this.offset = offset;
  21. this.size = size;
  22. }
  23. }
  24. public class SegmentToken
  25. {
  26. public SocketToken sToken { get; set; }
  27. public SegmentOffset Data { get; set; }
  28. public SegmentToken()
  29. {
  30. }
  31. public SegmentToken(SocketToken sToken)
  32. {
  33. this.sToken = sToken;
  34. }
  35. public SegmentToken(SocketToken sToken,SegmentOffset data)
  36. {
  37. this.sToken = sToken;
  38. this.Data = data;
  39. }
  40. public SegmentToken (SocketToken sToken,byte[] buffer)
  41. {
  42. this.sToken = sToken;
  43. this.Data = new SegmentOffset(buffer);
  44. }
  45. public SegmentToken(SocketToken sToken,byte[] buffer,int offset,int size)
  46. {
  47. this.sToken = sToken;
  48. this.Data = new SegmentOffset(buffer, offset, size);
  49. }
  50. }
  51. }