refactor: move media channel handling to common/ and setup duplex channel

a duplex media channel should be more realistic, you generally both send and receive media when doing video call and
stuff
This commit is contained in:
KokaKiwi 2025-08-16 18:48:43 +02:00
parent ff738ff045
commit 01bde142d4
No known key found for this signature in database
GPG key ID: FD333F84686EFE78
5 changed files with 187 additions and 102 deletions

View file

@ -1,9 +1,7 @@
package snowflake_client
import (
"crypto/rand"
"log"
"math/big"
"time"
)
@ -71,12 +69,3 @@ func (b *bytesSyncLogger) addOutbound(amount int64) {
func (b *bytesSyncLogger) addInbound(amount int64) {
b.inboundChan <- amount
}
func randomInt(min, max int) int {
nBig, err := rand.Int(rand.Reader, big.NewInt(int64(max-min)))
if err != nil {
panic(err)
}
return int(nBig.Int64()) + min
}