MCPcopy
hub / github.com/syncthing/syncthing / readerLoop

Method readerLoop

lib/protocol/protocol.go:407–425  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

405}
406
407func (c *rawConnection) readerLoop() {
408 fourByteBuf := make([]byte, 4)
409 for {
410 msg, err := c.readMessage(fourByteBuf)
411 if err != nil {
412 if errors.Is(err, errUnknownMessage) {
413 // Unknown message types are skipped, for future extensibility.
414 continue
415 }
416 c.internalClose(err)
417 return
418 }
419 select {
420 case c.inbox <- msg:
421 case <-c.closed:
422 return
423 }
424 }
425}
426
427func (c *rawConnection) dispatcherLoop() (err error) {
428 defer close(c.dispatcherLoopStopped)

Callers 1

StartMethod · 0.95

Calls 3

readMessageMethod · 0.95
internalCloseMethod · 0.95
IsMethod · 0.45

Tested by

no test coverage detected