]> Sergey Matveev's repositories - btrtrc.git/blob - webrtc.go
Create peer connections when WebRTC connections obtain a data channel
[btrtrc.git] / webrtc.go
1 package torrent
2
3 import (
4         "net"
5         "time"
6
7         "github.com/pion/datachannel"
8 )
9
10 type webrtcNetConn struct {
11         datachannel.ReadWriteCloser
12 }
13
14 type webrtcNetAddr struct {
15 }
16
17 func (webrtcNetAddr) Network() string {
18         return "webrtc"
19 }
20
21 func (webrtcNetAddr) String() string {
22         return ""
23 }
24
25 func (w webrtcNetConn) LocalAddr() net.Addr {
26         return webrtcNetAddr{}
27 }
28
29 func (w webrtcNetConn) RemoteAddr() net.Addr {
30         return webrtcNetAddr{}
31 }
32
33 func (w webrtcNetConn) SetDeadline(t time.Time) error {
34         return nil
35 }
36
37 func (w webrtcNetConn) SetReadDeadline(t time.Time) error {
38         return nil
39 }
40
41 func (w webrtcNetConn) SetWriteDeadline(t time.Time) error {
42         return nil
43 }