Exemple #1
0
func (c *Conn) read() (*plan9.Fcall, error) {
	if err := c.getErr(); err != nil {
		return nil, err
	}
	f, err := plan9.ReadFcall(c.rwc)
	if err != nil {
		c.setErr(err)
		return nil, err
	}
	return f, nil
}
Exemple #2
0
// Read calls from a input reader and send them to out
func readFCall(out chan *plan9.Fcall, done chan signal, err chan error, input io.Reader) {
loop:
	for {
		select {
		case <-done:
			close(out)
			break loop
		default:
			fc, e := plan9.ReadFcall(input)
			if e != nil {
				err <- e
				close(out)
				break
			}
			out <- fc
		}
	}
}