1 // Copyright 2018 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
13 // rawConn implements syscall.RawConn.
18 func (c *rawConn) Control(f func(uintptr)) error {
19 if err := c.file.checkValid("SyscallConn.Control"); err != nil {
22 err := c.file.pfd.RawControl(f)
23 runtime.KeepAlive(c.file)
27 func (c *rawConn) Read(f func(uintptr) bool) error {
28 if err := c.file.checkValid("SyscallConn.Read"); err != nil {
31 err := c.file.pfd.RawRead(f)
32 runtime.KeepAlive(c.file)
36 func (c *rawConn) Write(f func(uintptr) bool) error {
37 if err := c.file.checkValid("SyscallConn.Write"); err != nil {
40 err := c.file.pfd.RawWrite(f)
41 runtime.KeepAlive(c.file)
45 func newRawConn(file *File) (*rawConn, error) {
46 return &rawConn{file: file}, nil