hook_windows.go 875 B

123456789101112131415161718192021
  1. // Copyright 2015 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package net
  5. import (
  6. "internal/syscall/windows"
  7. "syscall"
  8. "time"
  9. )
  10. var (
  11. testHookDialChannel = func() { time.Sleep(time.Millisecond) } // see golang.org/issue/5349
  12. // Placeholders for socket system calls.
  13. socketFunc func(int, int, int) (syscall.Handle, error) = syscall.Socket
  14. wsaSocketFunc func(int32, int32, int32, *syscall.WSAProtocolInfo, uint32, uint32) (syscall.Handle, error) = windows.WSASocket
  15. connectFunc func(syscall.Handle, syscall.Sockaddr) error = syscall.Connect
  16. listenFunc func(syscall.Handle, int) error = syscall.Listen
  17. )