Golang implementation of the Reliable UDP transport, revised from an original documented mostly in chinese.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

conf.go 752B

12345678910111213141516171819202122232425
  1. package rudp
  2. import "time"
  3. //rudp
  4. var corruptTick int = 5
  5. var expiredTick int = 1e2 * 60 * 5 //5 minute on sendTick 1e7
  6. var sendDelayTick int = 1
  7. var missingTime int = 1e7
  8. func SetCorruptTick(tick int) { corruptTick = tick }
  9. func SetExpiredTick(tick int) { expiredTick = tick }
  10. func SetSendDelayTick(tick int) { sendDelayTick = tick }
  11. func SetMissingTime(miss int) { missingTime = miss }
  12. //rudp conn
  13. var debug bool = false
  14. var autoSend bool = true
  15. var sendTick time.Duration = 1e7
  16. var maxSendNumPerTick int = 500
  17. func SetDebug(d bool) { debug = d }
  18. func SetAtuoSend(send bool) { autoSend = send }
  19. func SetSendTick(tick time.Duration) { sendTick = tick }
  20. func SetMaxSendNumPerTick(n int) { maxSendNumPerTick = n }