简体   繁体   中英

NetTcpBinding() with TransferMode.Streamed

I am getting a timeout exception when trying to use a net tcp endpoint through code that has no security and is streamed like so:

NetTcpBinding binding = new NetTcpBinding(SecurityMode.None);
binding.TransferMode = TransferMode.Streamed;
binding.SendTimeout = TimeSpan.MaxValue;

the same code would work if i just leave out the SecurityMode.None or choose SecurityMode.Transport, the exception is on a timeout that is too low, i tired adding all the timeouts for recive, send, open, close and set them all to Max and that didnt work.

im using sample code from: http://csharp-codesamples.com/2009/02/data-transfer-using-self-hosted-wcf-service/

Any explenation as to how to use no security in this scenario would be appriciated.

Thanks, Totem

Sometimes WCF gives the wrong error message.

Only some security modes work when you are using streaming. You cannot sign a message, when you do not know how long it is.

Transport security mode works and is default, therefore it works when you do not specify the transport mode.

http://msdn.microsoft.com/en-us/library/ms731316.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM