pipe-io-server/pipe_io_server/clients/go/example.go
2019-08-05 17:38:29 +02:00

21 lines
278 B
Go

package main
import (
"log"
"./pipeio"
)
func main() {
pipeio, err := pipeio.NewPipeIO("in", "out")
if err != nil {
log.Fatal(err)
}
defer pipeio.Close()
pipeio.Reader.SetMessageHandler(func(msg []byte) {
pipeio.Writer.SendMessage(msg)
})
pipeio.Reader.Run()
}