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)
| 433 | // newTrafficMonitor returns a trafficMonitor for the specified codespace connection. |
| 434 | // It wraps the provided io.ReaderWriteCloser with its own Read/Write/Close methods. |
| 435 | func 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. |
| 440 | func (t *trafficMonitor) Read(p []byte) (n int, err error) { |
no outgoing calls
no test coverage detected