docs: fix some comments (#2391)

Co-authored-by: DylanYong <dylan.y@nodereal.io>
This commit is contained in:
VM
2023-06-29 01:12:31 +08:00
committed by GitHub
parent d616720a16
commit 8e341f7936
31 changed files with 47 additions and 46 deletions
+2 -2
View File
@@ -591,7 +591,7 @@ func (h *BasicHost) EventBus() event.Bus {
//
// host.Mux().SetHandler(proto, handler)
//
// (Threadsafe)
// (Thread-safe)
func (h *BasicHost) SetStreamHandler(pid protocol.ID, handler network.StreamHandler) {
h.Mux().AddHandler(pid, func(p protocol.ID, rwc io.ReadWriteCloser) error {
is := rwc.(network.Stream)
@@ -627,7 +627,7 @@ func (h *BasicHost) RemoveStreamHandler(pid protocol.ID) {
// NewStream opens a new stream to given peer p, and writes a p2p/protocol
// header with given protocol.ID. If there is no connection to p, attempts
// to create one. If ProtocolID is "", writes no header.
// (Threadsafe)
// (Thread-safe)
func (h *BasicHost) NewStream(ctx context.Context, p peer.ID, pids ...protocol.ID) (network.Stream, error) {
// Ensure we have a connection, with peer addresses resolved by the routing system (#207)
// It is not sufficient to let the underlying host connect, it will most likely not have