Skip to content

Commit

Permalink
implement the new quic-go API changes for net.PacketConn reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
noahlevenson committed Nov 16, 2023
1 parent fb8392c commit 15c26ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clientcore/quic.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type QUICLayerOptions struct {
func NewQUICLayer(bfconn *BroflakeConn, qopt *QUICLayerOptions) (*QUICLayer, error) {
q := &QUICLayer{
bfconn: bfconn,
t: &quic.Transport{Conn: bfconn},
tlsConfig: &tls.Config{
ServerName: qopt.ServerName,
InsecureSkipVerify: qopt.InsecureSkipVerify,
Expand All @@ -57,6 +58,7 @@ func NewQUICLayer(bfconn *BroflakeConn, qopt *QUICLayerOptions) (*QUICLayer, err

type QUICLayer struct {
bfconn *BroflakeConn
t *quic.Transport
tlsConfig *tls.Config
eventualConn *eventualConn
mx sync.RWMutex
Expand Down Expand Up @@ -86,7 +88,7 @@ func (c *QUICLayer) DialAndMaintainQUICConnection() {

go func() {
defer cancelDial()
conn, err := quic.Dial(ctxDial, c.bfconn, common.DebugAddr("NELSON WUZ HERE"), c.tlsConfig, &common.QUICCfg)
conn, err := c.t.Dial(ctxDial, common.DebugAddr("NELSON WUZ HERE"), c.tlsConfig, &common.QUICCfg)

if err != nil {
connErr <- err
Expand Down

0 comments on commit 15c26ab

Please sign in to comment.