//todo check to use streaming // server can use while loop to keep sending as long as there are items and the client is not disconnected (u can use the context callecation token) public async Task <FileChunkTransmissionResponse> SendFileChunk(FileChunkTransmissionRequest request) { WorkerLog.Instance.Information($"Filechunk received from {request.Host}"); var outgoingQueue = _workerQueueContainer.ReceivedChunks.Writer; if (await outgoingQueue.WaitToWriteAsync()) { await outgoingQueue.WriteAsync(new ReceivedFileChunk(Guid.Parse(request.FileId), request.SequenceNo, request.Value.ToByteArray(), request.Host, DummyAdress.Create(request.Host))); } return(_successFullFileChunkTransmissionResponse); }
public override async Task <FileChunkTransmissionResponse> SendFileChunk(FileChunkTransmissionRequest request, ServerCallContext context) { return(await _transmissionActions.SendFileChunk(request)); }