Source file
src/os/rawconn.go
1
2
3
4
5
6
7 package os
8
9 import (
10 "runtime"
11 )
12
13
14 type rawConn struct {
15 file *File
16 }
17
18 func (c *rawConn) Control(f func(uintptr)) error {
19 if err := c.file.checkValid("SyscallConn.Control"); err != nil {
20 return err
21 }
22 err := c.file.pfd.RawControl(f)
23 runtime.KeepAlive(c.file)
24 return err
25 }
26
27 func (c *rawConn) Read(f func(uintptr) bool) error {
28 if err := c.file.checkValid("SyscallConn.Read"); err != nil {
29 return err
30 }
31 err := c.file.pfd.RawRead(f)
32 runtime.KeepAlive(c.file)
33 return err
34 }
35
36 func (c *rawConn) Write(f func(uintptr) bool) error {
37 if err := c.file.checkValid("SyscallConn.Write"); err != nil {
38 return err
39 }
40 err := c.file.pfd.RawWrite(f)
41 runtime.KeepAlive(c.file)
42 return err
43 }
44
45 func newRawConn(file *File) (*rawConn, error) {
46 return &rawConn{file: file}, nil
47 }
48
View as plain text