MCPcopy Create free account
hub / github.com/imroc/req / StreamID

Method StreamID

internal/http3/protocol.go:68–90  ·  view source on GitHub ↗

StreamID calculates the stream ID.

(stype StreamType, pers Perspective)

Source from the content-addressed store, hash-verified

66
67// StreamID calculates the stream ID.
68func (s StreamNum) StreamID(stype StreamType, pers Perspective) quic.StreamID {
69 if s == 0 {
70 return InvalidStreamID
71 }
72 var first quic.StreamID
73 switch stype {
74 case StreamTypeBidi:
75 switch pers {
76 case PerspectiveClient:
77 first = 0
78 case PerspectiveServer:
79 first = 1
80 }
81 case StreamTypeUni:
82 switch pers {
83 case PerspectiveClient:
84 first = 2
85 case PerspectiveServer:
86 first = 3
87 }
88 }
89 return first + 4*quic.StreamID(s-1)
90}

Callers

nothing calls this directly

Calls 1

StreamIDMethod · 0.65

Tested by

no test coverage detected