forked from mengelbart/moqtransport
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quic_conn.go
43 lines (32 loc) · 1014 Bytes
/
quic_conn.go
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
package moqtransport
import (
"context"
"github.com/danielpfeifer02/quic-go-prio-packs"
)
type quicConn struct {
conn quic.Connection
}
func (c *quicConn) OpenStream() (stream, error) {
return c.conn.OpenStream()
}
func (c *quicConn) OpenStreamSync(ctx context.Context) (stream, error) {
return c.conn.OpenStreamSync(ctx)
}
func (c *quicConn) OpenUniStream() (sendStream, error) {
return c.conn.OpenUniStream()
}
func (c *quicConn) OpenUniStreamSync(ctx context.Context) (sendStream, error) {
return c.conn.OpenUniStreamSync(ctx)
}
func (c *quicConn) AcceptStream(ctx context.Context) (stream, error) {
return c.conn.AcceptStream(ctx)
}
func (c *quicConn) AcceptUniStream(ctx context.Context) (readStream, error) {
return c.conn.AcceptUniStream(ctx)
}
func (c *quicConn) ReceiveMessage(ctx context.Context) ([]byte, error) {
return c.conn.ReceiveDatagram(ctx)
}
func (c *quicConn) CloseWithError(e uint64, msg string) error {
return c.conn.CloseWithError(quic.ApplicationErrorCode(e), msg)
}