Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for streams in a contract #54

Open
DNikitenko opened this issue Dec 17, 2018 · 2 comments
Open

Add support for streams in a contract #54

DNikitenko opened this issue Dec 17, 2018 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@DNikitenko
Copy link

DNikitenko commented Dec 17, 2018

It is not possible now to declare a method returning Stream, e.g.

public interface IComputingService
{
    Stream GetBigFile();
}

In my use case machines need to transmit big index files between each other, and the file size can be up to 4 GB. There is no possibility to create a byte array more than 2GB. Even if it would be possible, it's undesirable to copy the whole file to memory of both sides of a communication channel.

When using WCF, streamed transmission mode can be used to achieve that. Here is an example of NetTcpBinding configuration:

private static Binding GetBinding()
{
    var binding = WcfHelper.GetNetTcpBinding();

    // Expand properties to allow the transfer of bigger files (> 100MB)
    var netTcpBinding = binding as NetTcpBinding;
    if (netTcpBinding != null)
    {
           netTcpBinding.TransferMode = TransferMode.Streamed;
           netTcpBinding.MaxReceivedMessageSize = Configuration.Instance.MaxSizeOfIndexFileInBytes;
    }
    binding.ReceiveTimeout = TimeSpan.FromMinutes(60);
    binding.SendTimeout = TimeSpan.FromMinutes(60);

    return binding;
}

It would be nice to have the same feature in the IpcServiceFramework.

@jacqueskang jacqueskang added this to the 2.3.0 milestone Dec 18, 2018
@jacqueskang jacqueskang added the enhancement New feature or request label Dec 18, 2018
@jacqueskang
Copy link
Owner

Thanks for your proposal and I totally agree that support streaming is a great idea.

@jacqueskang jacqueskang removed this from the 2.3.0 milestone Apr 28, 2020
@jacqueskang
Copy link
Owner

Sorry I didn't find my time to implement streaming support for v2.

@jacqueskang jacqueskang added the help wanted Extra attention is needed label May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants