Types
Yamux = ref object of Muxer channels: Table[uint32, YamuxChannel] flushed: Table[uint32, int] currentId: uint32 isClosed: bool maxChannCount: int windowSize: int maxSendQueueSize: int inTimeout: Duration outTimeout: Duration
- Source Edit
YamuxChannel = ref object of Connection id*: uint32 recvWindow: int sendWindow: int maxRecvWindow: int maxSendQueueSize: int conn*: Connection isSrc: bool opened: bool isSending: bool sendQueue: seq[ToSend] recvQueue: seq[byte] isReset: bool remoteReset: bool closedRemotely: Future[void].Raising([]) closedLocally: bool receivedData: AsyncEvent returnedEof: bool
- Source Edit
YamuxError = object of MuxerError
- Source Edit
YamuxHeader = object version: uint8 msgType: MsgType flags: set[MsgFlags] streamId: uint32 length: uint32
- Source Edit
Consts
YamuxCodec = "/yamux/1.0.0"
- Source Edit
YamuxDefaultWindowSize = 256000
- Source Edit
Procs
proc data(T: type[YamuxHeader]; streamId: uint32; length: uint32 = 0; flags: set[MsgFlags] = {}): T:type {....raises: [].}
- Source Edit
proc new(T: type[Yamux]; conn: Connection; maxChannCount: int = MaxChannelCount; windowSize: int = YamuxDefaultWindowSize; maxSendQueueSize: int = MaxSendQueueSize; inTimeout: Duration = 5.minutes; outTimeout: Duration = 5.minutes): T:type {. ...raises: [].}
- Source Edit
proc readHeader(conn: LPStream): InternalRaisesFuture[YamuxHeader, (CancelledError, LPStreamError, MuxerError)] {.stackTrace: false, ...raises: [], gcsafe, raises: [], raises: [], tags: [RootEffect].}
- Source Edit
proc setMaxRecvWindow(channel: YamuxChannel; maxRecvWindow: int) {....raises: [], tags: [].}
- Source Edit
proc windowUpdate(T: type[YamuxHeader]; streamId: uint32; delta: uint32; flags: set[MsgFlags] = {}): T:type {....raises: [].}
- Source Edit
proc write(conn: LPStream; header: YamuxHeader): InternalRaisesFuture[void, (CancelledError, LPStreamError)] {.stackTrace: false, ...raises: [], gcsafe, raises: [], raises: [], tags: [].}
- Source Edit
Methods
method close(m: Yamux): InternalRaisesFuture[void, void] {.stackTrace: false, ...raises: [], gcsafe, raises: [], raises: [], tags: [RootEffect].}
- Source Edit
method closeImpl(channel: YamuxChannel): InternalRaisesFuture[void, void] {. stackTrace: false, ...raises: [], gcsafe, raises: [], raises: [], tags: [RootEffect].}
- Source Edit
method getStreams(m: Yamux): seq[Connection] {....raises: [], tags: [].}
- Source Edit
method getWrapped(channel: YamuxChannel): Connection {....raises: [], tags: [].}
- Source Edit
method handle(m: Yamux): InternalRaisesFuture[void, void] {.stackTrace: false, ...raises: [], gcsafe, raises: [], raises: [], tags: [RootEffect].}
- Source Edit
method newStream(m: Yamux; name: string = ""; lazy: bool = false): InternalRaisesFuture[ Connection, (CancelledError, LPStreamError, MuxerError)] {. stackTrace: false, ...raises: [], gcsafe, raises: [], raises: [], tags: [RootEffect].}
- Source Edit
method readOnce(channel: YamuxChannel; pbytes: pointer; nbytes: int): InternalRaisesFuture[ int, (CancelledError, LPStreamError)] {.stackTrace: false, ...raises: [], gcsafe, raises: [], raises: [], tags: [RootEffect].}
- Read from a yamux channel Source Edit
method write(channel: YamuxChannel; msg: seq[byte]): InternalRaisesFuture[void, (CancelledError, LPStreamError)] {.stackTrace: false, ...raises: [], gcsafe, raises: [], raises: [], tags: [RootEffect].}
- Source Edit