MCPcopy Create free account
hub / github.com/cli/cli / newTrafficMonitor

Function newTrafficMonitor

internal/codespaces/portforwarder/port_forwarder.go:435–437  ·  view source on GitHub ↗

newTrafficMonitor returns a trafficMonitor for the specified codespace connection. It wraps the provided io.ReaderWriteCloser with its own Read/Write/Close methods.

(rwc io.ReadWriteCloser, fwd PortForwarder)

Source from the content-addressed store, hash-verified

433// newTrafficMonitor returns a trafficMonitor for the specified codespace connection.
434// It wraps the provided io.ReaderWriteCloser with its own Read/Write/Close methods.
435func newTrafficMonitor(rwc io.ReadWriteCloser, fwd PortForwarder) *trafficMonitor {
436 return &trafficMonitor{rwc, fwd}
437}
438
439// Read wraps the underlying ReadWriteCloser's Read method and keeps the session alive with the "input" traffic type.
440func (t *trafficMonitor) Read(p []byte) (n int, err error) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected