protected override void Create(out System.IO.Stream peer, out ISocketPortBuffers socketBuffer) { TestSocketPair pair = new TestSocketPair(); TestSocketPair was = Interlocked.Exchange(ref _tmpPair, pair); if (was != null) { was.Dispose(); } // peer = pair.StreamA; socketBuffer = new SocketBuffers(pair.SocketB); }
protected override void Create(out Stream peer, out ISocketPortBuffers socketBuffer) { TestRfCommIf iface; BluetoothClient cli; Stream tmpStrm2; TestRfcommPort port; WidcommBluetoothClientCommsTest.Create_ConnectedBluetoothClient(out iface, out port, out cli, out tmpStrm2); peer = cli.GetStream(); socketBuffer = new WidcommPortBuffers(port); // Start of with no capacity for write. socketBuffer.AllowWrite(0); }
protected static void ReleaseWriteOperation(ISocketPortBuffers port, byte[] data) { port.AllowWrite(data); }
abstract protected void Create(out Stream peer, out ISocketPortBuffers socketBuffer);
protected static void ReleaseReadOperation(ISocketPortBuffers port, byte[] data) { port.NewReceive(data); }