pipe-io-server/pipe_io_server/clients/go/example.go

21 lines
278 B
Go
Raw Permalink Normal View History

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()
}