diff options
Diffstat (limited to 'Emby.Common.Implementations/Net/NetAcceptSocket.cs')
| -rw-r--r-- | Emby.Common.Implementations/Net/NetAcceptSocket.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Emby.Common.Implementations/Net/NetAcceptSocket.cs b/Emby.Common.Implementations/Net/NetAcceptSocket.cs index 5f97fd854..5e831ac7a 100644 --- a/Emby.Common.Implementations/Net/NetAcceptSocket.cs +++ b/Emby.Common.Implementations/Net/NetAcceptSocket.cs @@ -108,6 +108,18 @@ namespace Emby.Common.Implementations.Net return completionSource.Task; } + public IAsyncResult BeginSendFile(string path, byte[] preBuffer, byte[] postBuffer, AsyncCallback callback, object state) + { + var options = TransmitFileOptions.UseDefaultWorkerThread; + + return Socket.BeginSendFile(path, preBuffer, postBuffer, options, new AsyncCallback(FileSendCallback), state); + } + + public void EndSendFile(IAsyncResult result) + { + Socket.EndSendFile(result); + } + private void FileSendCallback(IAsyncResult ar) { // Retrieve the socket from the state object. |
