Source File
conn.go
Belonging Package
github.com/libp2p/go-libp2p/p2p/muxer/yamux
package yamuximport ()// conn implements mux.MuxedConn over yamux.Session.type conn yamux.Sessionvar _ network.MuxedConn = &conn{}// NewMuxedConn constructs a new MuxedConn from a yamux.Session.func ( *yamux.Session) network.MuxedConn {return (*conn)()}// Close closes underlying yamuxfunc ( *conn) () error {return .yamux().Close()}func ( *conn) ( network.ConnErrorCode) error {return .yamux().CloseWithError(uint32())}// IsClosed checks if yamux.Session is in closed state.func ( *conn) () bool {return .yamux().IsClosed()}// OpenStream creates a new stream.func ( *conn) ( context.Context) (network.MuxedStream, error) {, := .yamux().OpenStream()if != nil {return nil, parseError()}return (*stream)(), nil}// AcceptStream accepts a stream opened by the other side.func ( *conn) () (network.MuxedStream, error) {, := .yamux().AcceptStream()return (*stream)(), parseError()}func ( *conn) () *yamux.Session {return (*yamux.Session)()}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |