Skip to content

Commit 82393f9

Browse files
committed
ms-select2: initial commit for multistream-select2
1 parent 17478b8 commit 82393f9

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lazyClient.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ func NewMSSelect[T StringLike](c io.ReadWriteCloser, proto T) LazyConn {
1717
}
1818
}
1919

20+
func NewMSSelect2[T StringLike](c io.ReadWriteCloser, proto T, peerProtos []T) LazyConn {
21+
// TODO: put peerProtos into lazyClientConn so that it knows what protocols the other peer supports
22+
return &lazyClientConn[T]{
23+
protos: []T{ProtocolID, proto},
24+
con: c,
25+
26+
rhandshakeOnce: newOnce(),
27+
whandshakeOnce: newOnce(),
28+
}
29+
}
30+
2031
// NewMultistream returns a multistream for the given protocol. This will not
2132
// perform any protocol selection. If you are using a MultistreamMuxer, use
2233
// NewMSSelect.

0 commit comments

Comments
 (0)