Remote playback almost working

This commit is contained in:
watsonb8
2019-11-03 23:17:34 -05:00
parent a13e491a7e
commit a537edd657
14 changed files with 296 additions and 136 deletions

View File

@ -1,39 +0,0 @@
using System;
using System.Threading.Tasks;
using System.IO;
using Aurora.Proto.Playback;
using Aurora.Proto.General;
using Aurora.Models;
namespace Aurora.RemoteImpl
{
public class RemotePlaybackServiceImpl : RemotePlaybackService.RemotePlaybackServiceBase
{
public RemotePlaybackServiceImpl()
{
}
public override Task GetPartyStream(Empty empty,
Grpc.Core.IServerStreamWriter<Chunk> responseStream,
Grpc.Core.ServerCallContext context)
{
throw new NotImplementedException("Working on it");
// //Send stream
// string cwd = Directory.GetCurrentDirectory();
// using (FileStream fs = System.IO.File.OpenRead(Path.Combine(cwd, request.FileName)))
// {
// Console.WriteLine("Begin sending file");
// byte[] buffer = new byte[2048]; // read in chunks of 2KB
// int bytesRead;
// while ((bytesRead = fs.Read(buffer, 0, buffer.Length)) > 0)
// {
// Google.Protobuf.ByteString bufferByteString = Google.Protobuf.ByteString.CopyFrom(buffer);
// await responseStream.WriteAsync(new Chunk { Content = bufferByteString });
// }
// Console.WriteLine("Done sending file");
// };
}
}
}