mirror of
https://github.com/fluencelabs/js-libp2p-interfaces
synced 2025-04-24 17:52:21 +00:00
Landing off the field for test suite
This commit is contained in:
parent
31d079cfa9
commit
30a754b92d
@ -32,13 +32,15 @@ A valid (read: that follows this abstraction) stream muxer, must implement the f
|
|||||||
|
|
||||||
### Attach muxer to a transport
|
### Attach muxer to a transport
|
||||||
|
|
||||||
- `Node.js` muxer.attach(transport, function (err, conn))
|
- `Node.js` muxer.attach(transport, isListener, function (err, conn))
|
||||||
- `Go` conn, err := muxer.Attach(transport)
|
- `Go` conn, err := muxer.Attach(transport, isListener)
|
||||||
|
|
||||||
This method attaches our stream muxer to the desired transport (UDP, TCP) and returns/callbacks with the `err, conn`(error, connection).
|
This method attaches our stream muxer to the desired transport (UDP, TCP) and returns/callbacks with the `err, conn`(error, connection).
|
||||||
|
|
||||||
If `err` is passed, no operation should be made in `conn`.
|
If `err` is passed, no operation should be made in `conn`.
|
||||||
|
|
||||||
|
`isListener` is a bool that tells the side of the socket we are, `isListener = true` for listener/server and `isListener = false` for dialer/client side.
|
||||||
|
|
||||||
`conn` abstracts our established Connection with the other endpoint, it must offer an interface to open a stream inside this connection and to receive incomming stream requests.
|
`conn` abstracts our established Connection with the other endpoint, it must offer an interface to open a stream inside this connection and to receive incomming stream requests.
|
||||||
|
|
||||||
### Dial(open/create) a new stream
|
### Dial(open/create) a new stream
|
||||||
|
28
package.json
Normal file
28
package.json
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"name": "abstract-stream-muxer",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"description": "A test suite and interface you can use to implement a stream muxer.",
|
||||||
|
"main": "src/index.js",
|
||||||
|
"directories": {
|
||||||
|
"test": "tests"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/diasdavid/abstract-stream-muxer.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"Streams",
|
||||||
|
"Muxer",
|
||||||
|
"Abstract",
|
||||||
|
"Interface"
|
||||||
|
],
|
||||||
|
"author": "David Dias <daviddias@ipfs.io>",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/diasdavid/abstract-stream-muxer/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/diasdavid/abstract-stream-muxer"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user