private bool Delete(DataBatch batch, TcpResponse tcpResponse) { var response = tcpResponse.Content; var key = batch.Properties["key"]; var deleted = _blobStore.Delete<MultilayerNetwork>(key); batch.Properties["Deleted"] = deleted.ToString(); batch.Save(response); return deleted; }
private static async Task Send(TransferHandle state, DataBatch transferDoc, ICompressionProvider compression) { var buffer = new byte[state.BufferSize]; using (var ms = new MemoryStream()) using (var cs = compression.CompressTo(ms)) { transferDoc.Save(cs); cs.Flush(); cs.Dispose(); ms.Flush(); ms.Position = 0; var sockWriter = new AsyncSocketWriterReader(state.ClientSocket, state.BufferSize); var sent = await sockWriter.WriteAsync(ms); DebugOutput.LogVerbose("Sent {0} bytes", sent); } }