KcpHeader.cs 810 B

12345678910111213141516171819
  1. namespace kcp2k
  2. {
  3. // header for messages processed by kcp.
  4. // this is NOT for the raw receive messages(!) because handshake/disconnect
  5. // need to be sent reliably. it's not enough to have those in rawreceive
  6. // because those messages might get lost without being resent!
  7. public enum KcpHeader : byte
  8. {
  9. // don't react on 0x00. might help to filter out random noise.
  10. Handshake = 0x01,
  11. // ping goes over reliable & KcpHeader for now. could go over reliable
  12. // too. there is no real difference except that this is easier because
  13. // we already have a KcpHeader for reliable messages.
  14. // ping is only used to keep it alive, so latency doesn't matter.
  15. Ping = 0x02,
  16. Data = 0x03,
  17. Disconnect = 0x04
  18. }
  19. }