conn.go 1004 Bytes
Newer Older
Marten Seemann's avatar
Marten Seemann committed
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
51
52
53
54
55
56
57
58
59
60
package libp2pquic

import (
	"net"
	"time"

	tpt "github.com/libp2p/go-libp2p-transport"
	ma "github.com/multiformats/go-multiaddr"
)

type conn struct {
	quicConn  net.Conn
	transport tpt.Transport
}

func (c *conn) Read(p []byte) (int, error) {
	return c.quicConn.Read(p)
}

func (c *conn) Write(p []byte) (int, error) {
	return c.quicConn.Write(p)
}

func (c *conn) Close() error {
	return c.quicConn.Close()
}

func (c *conn) LocalAddr() net.Addr {
	return c.quicConn.LocalAddr()
}

func (c *conn) RemoteAddr() net.Addr {
	return c.quicConn.RemoteAddr()
}

func (c *conn) LocalMultiaddr() ma.Multiaddr {
	panic("not implemented")
}

func (c *conn) RemoteMultiaddr() ma.Multiaddr {
	panic("not implemented")
}

func (c *conn) Transport() tpt.Transport {
	return c.transport
}

func (c *conn) SetDeadline(t time.Time) error {
	return nil
}

func (c *conn) SetReadDeadline(t time.Time) error {
	return nil
}

func (c *conn) SetWriteDeadline(t time.Time) error {
	return nil
}

var _ tpt.Conn = &conn{}