WrapSyscallConn tries to wrap rawConn and newConn into a net.Conn that implements syscall.Conn. rawConn will be used to support syscall, and newConn will be used for read/write. This function returns newConn if rawConn doesn't implement syscall.Conn.
(rawConn, newConn net.Conn)
| 47 | // |
| 48 | // This function returns newConn if rawConn doesn't implement syscall.Conn. |
| 49 | func WrapSyscallConn(rawConn, newConn net.Conn) net.Conn { |
| 50 | sysConn, ok := rawConn.(syscall.Conn) |
| 51 | if !ok { |
| 52 | return newConn |
| 53 | } |
| 54 | return &syscallConn{ |
| 55 | Conn: newConn, |
| 56 | sysConn: sysConn, |
| 57 | } |
| 58 | } |
no outgoing calls