| // Copyright 2015 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // Placeholders for saving original socket system calls. |
| origClosesocket = closeFunc |
| origConnect = connectFunc |
| origConnectEx = connectExFunc |
| func installTestHooks() { |
| closeFunc = sw.Closesocket |
| connectExFunc = sw.ConnectEx |
| func uninstallTestHooks() { |
| closeFunc = origClosesocket |
| connectFunc = origConnect |
| connectExFunc = origConnectEx |
| func forceCloseSockets() { |
| for s := range sw.Sockets() { |