[英]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: 尝试通过不具有安全性并且像这样流式传输的代码使用净TCP端点时遇到超时异常:
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. 如果我只是不选择SecurityMode.None或选择SecurityMode.Transport,则相同的代码将起作用,例外是超时时间太短,我累加了接收,发送,打开,关闭和设置所有超时的所有超时时间马克斯,那没有用。
im using sample code from: http://csharp-codesamples.com/2009/02/data-transfer-using-self-hosted-wcf-service/ 即时通讯使用的示例代码来自: 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. 有时WCF给出错误的错误消息。
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 http://msdn.microsoft.com/en-us/library/ms731316.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.