WCF supports the streamed or buffered mode to transfer the
request /response message from client to server or vice versa
Differences between Buffered and Streamed Transfers
Note :
Type of Transfer Mode :
- Buffered - no streaming only buffering
- Streamed - both direction of request message and response message will be streamed.
- StreamedRequest - request message send from client to service will be streamed.
- StreamedResponse - response message send from service to client will be streamed.
1.
Buffered Mode :
WCF holds the entire message in
local memory buffer until transfer is completed it means a receiver can read
message once it is completed delivered.
WCF Configuration:
<basicHttpBinding>
<binding name="BasicHttpBindingService" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" transferMode="Buffered" />
</basicHttpBinding>
2.
Streamed Mode :
WCF hold only the message header
only and it start transferring the small part of message body as stream and receive
can start read the message, before it is completely delivered.
WCF Configuration:
<basicHttpBinding>
<binding name="BasicHttpBindingService" maxReceivedMessageSize="2147483647" transferMode="Streamed"
</basicHttpBinding>
Differences between Buffered and Streamed Transfers
Buffered
|
Streamed
|
client can process or read the
message once it is completely received
|
Client can start processing the data when it is partially received
|
Performance will be good when message size is small
|
Performance will be good when message size is larger(more than 64K)
|
Note :
- By default, Streaming is disabled for all bindings
- TCP, IPC and HTTP Binding support streaming transfer mode
- For small size Message, by default transfer mode option is good but if message size is larger, you have to choose the streaming mode for better performance
- No OutOfMemory exceptions anymore for larger size data processing , if you choose streaming mode
Thanks for Visiting!!
No comments:
Post a Comment