@@ -26,8 +26,8 @@ func (s *Session) CreateConnection() error {
2626 if err != nil {
2727 return err
2828 }
29- s .peerConnection = peerConnection
30- s .gatherDone = webrtc .GatheringCompletePromise (s .peerConnection )
29+ s .PeerConnection = peerConnection
30+ s .gatherDone = webrtc .GatheringCompletePromise (s .PeerConnection )
3131 s .HandleState ()
3232 return nil
3333}
@@ -62,13 +62,13 @@ func (s *Session) transfer() {
6262 mpb .PrependDecorators (
6363 decor .Name (fmt .Sprintf ("Receiving '%s': " , s .Channels [i ].Name ), decor .WCSyncSpaceR ),
6464
65- //Make the size counter disapper on completion.
65+ //Make the size counter disappear on completion.
6666 // decor.OnComplete(decor.Counters(decor.SizeB1024(0), "% .2f / % .2f", decor.WCSyncSpaceR), ""),
6767
6868 //display the received amount
6969 //decor.SizeB1024 converts the amount into appropriate units of data (KiB,MiB,Gib)
7070 decor .OnComplete (decor .Any (func (st decor.Statistics ) string {
71- stats , _ := s .peerConnection .GetStats ().GetDataChannelStats (doc .DC )
71+ stats , _ := s .PeerConnection .GetStats ().GetDataChannelStats (doc .DC )
7272 return fmt .Sprintf ("% .2f " , decor .SizeB1024 (int64 (stats .BytesReceived )))
7373 }, decor .WCSyncSpaceR ), "" ),
7474
@@ -78,7 +78,7 @@ func (s *Session) transfer() {
7878 period := float64 (time .Now ().UnixMilli ()- doc .StartTime ) / 1000.0
7979
8080 // If the clients are disconnected, do not update speed.
81- if s .peerConnection .ICEConnectionState () == webrtc .ICEConnectionStateDisconnected {
81+ if s .PeerConnection .ICEConnectionState () == webrtc .ICEConnectionStateDisconnected {
8282 return fmt .Sprintf ("%.2f MiB/s" , 0.0 )
8383 }
8484 return fmt .Sprintf ("%.2f MiB/s" , amount / period )
@@ -149,24 +149,24 @@ func (s *Session) fileWrite(proxyWriter io.WriteCloser, wg *sync.WaitGroup, i in
149149
150150func (s * Session ) GenSDP (offer webrtc.SessionDescription ) (string , error ) {
151151 var sdp string
152- err := s .peerConnection .SetRemoteDescription (offer )
152+ err := s .PeerConnection .SetRemoteDescription (offer )
153153 if err != nil {
154154 return sdp , err
155155 }
156156
157- answer , err := s .peerConnection .CreateAnswer (nil )
157+ answer , err := s .PeerConnection .CreateAnswer (nil )
158158 if err != nil {
159159 return sdp , err
160160 }
161161
162- err = s .peerConnection .SetLocalDescription (answer )
162+ err = s .PeerConnection .SetLocalDescription (answer )
163163 if err != nil {
164164 return sdp , err
165165 }
166166 <- s .gatherDone
167167
168168 //Encode the SDP to base64
169- sdp , err = lib .Encode (s .peerConnection .LocalDescription ())
169+ sdp , err = lib .Encode (s .PeerConnection .LocalDescription ())
170170 return sdp , err
171171}
172172
0 commit comments