-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #836 from libp2p/feat/reliable-mock-notif
feat(mock): reliable notifications
- Loading branch information
Showing
6 changed files
with
161 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package mocknet | ||
|
||
import ( | ||
"github.com/libp2p/go-libp2p-core/network" | ||
) | ||
|
||
// StreamComplement returns the other end of the given stream. This function | ||
// panics when passed a non-mocknet stream. | ||
func StreamComplement(s network.Stream) network.Stream { | ||
return s.(*stream).rstream | ||
} | ||
|
||
// ConnComplement returns the other end of the given connection. This function | ||
// panics when passed a non-mocknet connection. | ||
func ConnComplement(c network.Conn) network.Conn { | ||
return c.(*conn).rconn | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.