add multiplex indication for pht

This commit is contained in:
ginuerzh 2022-11-02 20:44:55 +08:00
parent dc2fe32a2a
commit 76fbcb2046

View File

@ -61,6 +61,12 @@ func (d *phtDialer) Init(md md.Metadata) (err error) {
return nil return nil
} }
// Multiplex implements dialer.Multiplexer interface.
// NOTE: PHT is not a real multiplexed tunnel.
func (d *phtDialer) Multiplex() bool {
return true
}
func (d *phtDialer) Dial(ctx context.Context, addr string, opts ...dialer.DialOption) (net.Conn, error) { func (d *phtDialer) Dial(ctx context.Context, addr string, opts ...dialer.DialOption) (net.Conn, error) {
d.clientMutex.Lock() d.clientMutex.Lock()
defer d.clientMutex.Unlock() defer d.clientMutex.Unlock()