func NewMemStream() (Stream, Stream) {
	var a, b memStream
	a.write = make(chan Packet, 8)
	a.sigClose = make(chan struct{}, 1)
	b.write = make(chan Packet, 8)
	b.sigClose = make(chan struct{}, 1)
	a.sibling = &b
	b.sibling = &a
	return &a, &b
}
// NewMemStream creates a upstream + downstream pair.
// Write to one stream and read that on the other.
// Close a stream to make the others reading fail (half side closed).
// We use MemStream to avoid the TCP layer for testing - now the tests
// can be done in memory, thats pretty cool and very fast.
NewMemStream creates a upstream + downstream pair.
Write to one stream and read that on the other.
Close a stream to make the others reading fail (half side closed).
We use MemStream to avoid the TCP layer for testing - now the tests
can be done in memory, thats pretty cool and very fast.
// NewMemStream creates a upstream + downstream pair . // Write to one stream and read that on the other . // Close a stream to make the others reading fail ( half side closed ) . // We use MemStream to avoid the TCP layer for testing - now the tests // can be done in memory thats pretty cool and very fast .
func NewMemStream() (Stream, Stream) {
	var a, b memStream
	a.write = make(chan Packet, 8)
	a.sigClose = make(chan struct{}, 1)
	b.write = make(chan Packet, 8)
	b.sigClose = make(chan struct{}, 1)
	a.sibling = &b
	b.sibling = &a
	return &a, &b
}
func NewMemStream ( ) ( Stream , Stream ) { var a , b memStream a . write = make ( chan Packet , 8 ) a . sigClose = make ( chan struct { } , 1 ) b . write = make ( chan Packet , 8 ) b . sigClose = make ( chan struct { } , 1 ) a . sibling = & b b . sibling = & a return & a , & b }
NewMemStream creates a upstream + downstream pair.
NewMemStream creates a upstream + downstream pair .