help_windows_test.go 286 B

1234567891011121314151617181920
  1. package door
  2. import (
  3. "net"
  4. )
  5. func socket_to_fd(socket net.Conn) int {
  6. client_conn := socket.(*net.TCPConn)
  7. raw, _ := client_conn.SyscallConn()
  8. var fd int
  9. raw.Control(func(sfd uintptr) {
  10. fd = int(sfd)
  11. })
  12. return fd
  13. }
  14. // nothing to close in Windows
  15. func close_fd(fd int) {
  16. }