Skip to content

Commit

Permalink
Add SignalR event handler for file transfer (for when WebRTC fails).
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed May 30, 2020
1 parent 29a3611 commit f779f1d
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 152 deletions.
5 changes: 0 additions & 5 deletions ScreenCast.Core/Services/FileTransferService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ public async Task ReceiveFile(byte[] buffer, string fileName, string messageId,
{
fileStream.Close();
partialTransfers.Remove(messageId, out _);
if (EnvironmentHelper.IsWindows)
{
Process.Start("explorer.exe", baseDir);
}
}
}
catch (Exception ex)
Expand All @@ -101,7 +97,6 @@ public async Task ReceiveFile(byte[] buffer, string fileName, string messageId,
finally
{
writeLock.Release();

if (endOfFile)
{
await Task.Run(ShowTransferComplete);
Expand Down
10 changes: 9 additions & 1 deletion Server/Services/RCBrowserHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,15 @@ public Task SendClipboardTransfer(string transferText, bool typeText)
{
return RCDeviceHubContext.Clients.Client(ScreenCasterID).SendAsync("ClipboardTransfer", transferText, typeText, Context.ConnectionId);
}

public async Task SendFile(byte[] buffer, string fileName, string messageId, bool endOfFile, bool startOfFile)
{
await RCDeviceHubContext.Clients.Client(ScreenCasterID).SendAsync("ReceiveFile",
buffer,
fileName,
messageId,
endOfFile,
startOfFile);
}
public Task SendFrameReceived(int bytesReceived)
{
return RCDeviceHubContext.Clients.Client(ScreenCasterID).SendAsync("FrameReceived", bytesReceived, Context.ConnectionId);
Expand Down
2 changes: 1 addition & 1 deletion Server/wwwroot/scripts/RemoteControl/MessageSender.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f779f1d

Please sign in to comment.