1234567891011121314151617181920 |
- package door
- import (
- "net"
- )
- func socket_to_fd(socket net.Conn) int {
- client_conn := socket.(*net.TCPConn)
- raw, _ := client_conn.SyscallConn()
- var fd int
- raw.Control(func(sfd uintptr) {
- fd = int(sfd)
- })
- return fd
- }
- // nothing to close in Windows
- func close_fd(fd int) {
- }
|