Skip to content

Commit

Permalink
added monkey-patched with context exchange
Browse files Browse the repository at this point in the history
  • Loading branch information
phillip-stephens committed Jun 10, 2024
1 parent 9953c26 commit 02ea112
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ func (c *Client) ExchangeWithConnTo(m *Msg, conn *Conn, addr net.Addr) (r *Msg,
return c.ExchangeWithConn(m, conn)
}

func (c *Client) ExchangeWithConnToContext(ctx context.Context, m *Msg, conn *Conn, addr net.Addr) (r *Msg, rtt time.Duration, err error) {
conn.UnboundUDP = true
conn.RemoteAddr = addr
return c.ExchangeWithConnContext(ctx, m, conn)
}

// END MONKEY PATCH

// ExchangeWithConn has the same behavior as Exchange, just with a predetermined connection
Expand Down

0 comments on commit 02ea112

Please sign in to comment.