func (us *UnixSock) processBuffer(fd io.ReadWriter) { var buf [1024]byte for { n, err := fd.Read(buf[0:]) if err != nil || n == 0 { break } us.data <- pipe.NewSimpleChunk(buf[0:n]) } }
func (us *UDPSource) Run(l *net.UDPConn) { // Why doesn't this get called on ctrl + c var buf [1024]byte for { n, err := l.Read(buf[0:]) if err != nil || n == 0 { break } us.data <- pipe.NewSimpleChunk(buf[0:n]) } }