pcap_windows.go 545 B

1234567891011121314151617181920212223
  1. // Copyright 2012 Google, Inc. All rights reserved.
  2. // Copyright 2009-2011 Andreas Krennmair. All rights reserved.
  3. //
  4. // Use of this source code is governed by a BSD-style license
  5. // that can be found in the LICENSE file in the root of the source
  6. // tree.
  7. package pcap
  8. import (
  9. "runtime"
  10. )
  11. func (p *Handle) setNonBlocking() error {
  12. // do nothing
  13. return nil
  14. }
  15. // waitForPacket waits for a packet or for the timeout to expire.
  16. func (p *Handle) waitForPacket() {
  17. // can't use select() so instead just switch goroutines
  18. runtime.Gosched()
  19. }