MCPcopy Create free account
hub / github.com/SamNet-dev/snix / Run

Method Run

core/engine/engine.go:90–103  ·  view source on GitHub ↗

Run consumes the backend's packet stream until ctx is done.

(ctx context.Context)

Source from the content-addressed store, hash-verified

88
89// Run consumes the backend's packet stream until ctx is done.
90func (e *Engine) Run(ctx context.Context) error {
91 ch := e.backend.Packets()
92 for {
93 select {
94 case <-ctx.Done():
95 return nil
96 case packet, ok := <-ch:
97 if !ok {
98 return nil
99 }
100 e.dispatch(packet)
101 }
102 }
103}
104
105// dispatch classifies the packet, updates flow state, and decides on a
106// verdict. It MUST call packet.Verdict exactly once.

Callers 9

RunFunction · 0.80
TestClientHelloGoldenFunction · 0.80
runEngineFunction · 0.80
runEngineFunction · 0.80
mustBeRootFunction · 0.80
TestParseRejectsFunction · 0.80

Calls 2

dispatchMethod · 0.95
PacketsMethod · 0.65

Tested by 6

TestClientHelloGoldenFunction · 0.64
mustBeRootFunction · 0.64
TestParseRejectsFunction · 0.64