errors.go 491 B

123456789101112131415161718192021222324252627
  1. package packetio
  2. import (
  3. "errors"
  4. )
  5. // netError implements net.Error
  6. type netError struct {
  7. error
  8. timeout, temporary bool
  9. }
  10. func (e *netError) Timeout() bool {
  11. return e.timeout
  12. }
  13. func (e *netError) Temporary() bool {
  14. return e.temporary
  15. }
  16. var (
  17. // ErrFull is returned when the buffer has hit the configured limits.
  18. ErrFull = errors.New("packetio.Buffer is full, discarding write")
  19. // ErrTimeout is returned when a deadline has expired
  20. ErrTimeout = errors.New("i/o timeout")
  21. )