//Send a message to the game window protected void Write(string msg) { //GameWindow.Write(msg); //msg += Environment.NewLine; OnWriting?.Invoke(msg); }
public AdbStream(IAdbSocket sock, uint localId) { _sock = sock; this.LocalId = localId; _outputBlock = new BufferBlock <byte[]>(); _inputBlock = new ActionBlock <byte[]>(bytes => { var buff = Command.CreateWriteCommand(LocalId, RemoteId, bytes); OnWriting?.Invoke(this, EventArgs.Empty); if (RemoteId == 0) { throw new Exception("Remote stream not established yet!"); } _sock.Send(buff, buff.Length); }); Block = DataflowBlock.Encapsulate(_inputBlock, _outputBlock); }
public AdbLocalStream(IAdbSocket sock, uint localId, Encoding encoding, CancellationToken ct) { _sock = sock; _oStream = sock.GetShellStream(); _outputBlock = new BufferBlock <byte[]>(); _inputBlock = new ActionBlock <byte[]>(bytes => { var buff = Command.CreateWriteCommand(LocalId, RemoteId, bytes); OnWriting?.Invoke(this, EventArgs.Empty); if (RemoteId == 0) { throw new Exception("Remote stream not established yet!"); } _sock.Send(buff, buff.Length); }); Block = DataflowBlock.Encapsulate(_inputBlock, _outputBlock); HandleData(encoding, ct).ConfigureAwait(false); }
//Send a message to the game window void Write(string msg) { OnWriting?.Invoke(msg); }
public override void WriteLine(string message) { OnWriting?.Invoke(message); }
public override void Write(char value) { OnWriting?.Invoke(value); }