I've also looked at these streams but had left them alone.
Network stream works well with both Read and Write. But still not sure
about multithreaded Read/Write. BufferedStream internally uses one
buffer for both.
From 
https://github.com/dotnet/coreclr/blob/master/src/mscorlib/src/System/IO/BufferedStream.cs
/// Class Invariants:
/// The class has one buffer, shared for reading & writing.
/// It can only be used for one or the other at any point in time - not both.
Again, for current implementation using two streams is redundant, but
if async involved I can't tell anything.

On 17 September 2015 at 16:51, Jiří Činčura <j...@cincura.net> wrote:
> HI *,
>
> I'm looking at
> https://github.com/cincuranet/FirebirdSql.Data.FirebirdClient/blob/master/NETProvider/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsConnection.cs#L136
> and wondering why there's two streams? The underlying network stream
> (https://github.com/cincuranet/FirebirdSql.Data.FirebirdClient/blob/master/NETProvider/src/FirebirdSql.Data.FirebirdClient/Client/Managed/Version10/GdsConnection.cs#L204)
> is just one.
>
> There's no interleaving so why to have two. And also you can't have
> interleaving because you might have dangling buffer data (or rigorously
> flush, and that's back to no interleaving case).
>
> Or am I missing something?
>
> --
> Mgr. Jiří Činčura
> Independent IT Specialist
>
> ------------------------------------------------------------------------------
> Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
> Get real-time metrics from all of your servers, apps and tools
> in one place.
> SourceForge users - Click here to start your Free Trial of Datadog now!
> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
> _______________________________________________
> Firebird-net-provider mailing list
> Firebird-net-provider@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to