public async Task <IPropagatorBlock <byte[], byte[]> > CreateStream(string path) { var streamId = _streamId++; var buff = Command.CreateOpenCommand(path, streamId); _socket.Send(buff, buff.Length); var stream = new AdbStream(_socket, streamId); stream.OnWriting += StreamWriting; OpenStreams.Add(streamId, stream); StartReading(); return(stream.Block); }
private async Task <RemoteAdbDevice> Connect(IPEndPoint endpoint) { this.EndPoint = endpoint; _socket = new AdbSocket(endpoint); //_socket.Connect(endpoint); var cmd = Command.CreateConnectCommand(); _socket.Send(cmd, cmd.Length); var connectionPacket = await ReceivePacket(true); StartReading(); return(this); }