File tree Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Expand file tree Collapse file tree 2 files changed +60
-0
lines changed Original file line number Diff line number Diff line change
1
+ //go:build wasi
2
+ // +build wasi
3
+
4
+ package net
5
+
6
+ import (
7
+ "io"
8
+ "os"
9
+ "syscall"
10
+ "time"
11
+ )
12
+
13
+ // Network file descriptor.
14
+ type netFD struct {
15
+ * os.File
16
+
17
+ net string
18
+ laddr Addr
19
+ raddr Addr
20
+ }
21
+
22
+ // Read implements the Conn Read method.
23
+ func (c * netFD ) Read (b []byte ) (int , error ) {
24
+ // TODO: Handle EAGAIN and perform poll
25
+ return c .File .Read (b )
26
+ }
27
+
28
+ // Write implements the Conn Write method.
29
+ func (c * netFD ) Write (b []byte ) (int , error ) {
30
+ // TODO: Handle EAGAIN and perform poll
31
+ return c .File .Write (b )
32
+ }
33
+
34
+ // LocalAddr implements the Conn LocalAddr method.
35
+ func (* netFD ) LocalAddr () Addr {
36
+ return nil
37
+ }
38
+
39
+ // RemoteAddr implements the Conn RemoteAddr method.
40
+ func (* netFD ) RemoteAddr () Addr {
41
+ return nil
42
+ }
43
+
44
+ // SetDeadline implements the Conn SetDeadline method.
45
+ func (* netFD ) SetDeadline (t time.Time ) error {
46
+ return ErrNotImplemented
47
+ }
48
+
49
+ // SetReadDeadline implements the Conn SetReadDeadline method.
50
+ func (* netFD ) SetReadDeadline (t time.Time ) error {
51
+ return ErrNotImplemented
52
+ }
53
+
54
+ // SetWriteDeadline implements the Conn SetWriteDeadline method.
55
+ func (* netFD ) SetWriteDeadline (t time.Time ) error {
56
+ return ErrNotImplemented
57
+ }
Original file line number Diff line number Diff line change 6
6
7
7
// Fake networking. It is intended to allow tests of other package to pass.
8
8
9
+ //go:build !wasi
10
+ // +build !wasi
11
+
9
12
package net
10
13
11
14
import (
You can’t perform that action at this time.
0 commit comments