| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| func newMRWPair(ctx *context.T) (flow.MsgReadWriter, flow.MsgReadWriter) { |
| ac, bc := make(chan []byte), make(chan []byte) |
| a := &mRW{recieve: ac, send: bc, ctx: ctx} |
| b := &mRW{recieve: bc, send: ac, ctx: ctx} |
| func (f *mRW) WriteMsg(data ...[]byte) (int, error) { |
| f.ctx.VI(5).Infof("Wrote: %v", buf) |
| func (f *mRW) ReadMsg() (buf []byte, err error) { |
| f.ctx.VI(5).Infof("Read: %v", buf) |
| func (fh fh) HandleFlow(f flow.Flow) error { |
| panic("writing to nil flow handler") |