MCPcopy Create free account
hub / github.com/celzero/midway / processtcp

Function processtcp

midway/echo.go:111–119  ·  view source on GitHub ↗
(c net.Conn)

Source from the content-addressed store, hash-verified

109}
110
111func processtcp(c net.Conn) {
112 defer c.Close()
113
114 line, _ := bufio.NewReader(c).ReadString('\n')
115 log.Printf("tmsg: %d - %s / by: %s\n", len(line), string(line), c.RemoteAddr().String())
116 // echo msg and rip back
117 fmt.Fprint(c, line)
118 fmt.Fprint(c, c.RemoteAddr())
119}

Callers 2

EchoTCPFunction · 0.85
EchoPPFunction · 0.85

Calls 2

RemoteAddrMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected