File: ioconn.go

package info (click to toggle)
golang-github-containers-gvisor-tap-vsocks 0.8.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 800 kB
  • sloc: sh: 95; makefile: 59
file content (50 lines) | stat: -rw-r--r-- 733 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package stdio

import (
	"io"
	"net"
	"time"
)

type IoConn struct {
	writer io.Writer
	reader io.Reader
	local  net.Addr
	remote net.Addr
	close  func() error
}

func (c IoConn) Read(b []byte) (n int, err error) {
	return c.reader.Read(b)
}

func (c IoConn) Write(b []byte) (n int, err error) {
	return c.writer.Write(b)
}

func (c IoConn) Close() error {
	if c.close != nil {
		return c.close()
	}
	return nil
}

func (c IoConn) LocalAddr() net.Addr {
	return c.local
}

func (c IoConn) RemoteAddr() net.Addr {
	return c.remote
}

func (c IoConn) SetDeadline(_ time.Time) error {
	return nil
}

func (c IoConn) SetReadDeadline(_ time.Time) error {
	return nil
}

func (c IoConn) SetWriteDeadline(_ time.Time) error {
	return nil
}