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.

net_windows.go 560B

12345678910111213141516171819
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. // This code is heavily inspired by the archived gofacebook/gracenet/net.go handler
  4. //go:build windows
  5. package graceful
  6. import "net"
  7. // GetListener obtains a listener for the local network address.
  8. // On windows this is basically just a shim around net.Listen.
  9. func GetListener(network, address string) (net.Listener, error) {
  10. // Add a deferral to say that we've tried to grab a listener
  11. defer GetManager().InformCleanup()
  12. return net.Listen(network, address)
  13. }