MCPcopy Create free account
hub / github.com/devfullcycle/goexpert / Process

Method Process

labs/streaming/aluno/server/server.go:29–43  ·  view source on GitHub ↗
(conn net.Conn)

Source from the content-addressed store, hash-verified

27}
28
29func (ss *StreamServer) Process(conn net.Conn) {
30 buf := new(bytes.Buffer)
31 for {
32 var size int64
33 binary.Read(conn, binary.LittleEndian, &size)
34
35 qtdBytes, err := io.CopyN(buf, conn, size)
36 if err != nil {
37 log.Fatal(err)
38 }
39 fmt.Println(buf.Bytes())
40 fmt.Println("Received", qtdBytes, "bytes from client")
41 break
42 }
43}
44
45func main() {
46 ss := &StreamServer{}

Callers 1

ConnectAndReadFileMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected