假设我有一个向 WCF 服务器发送消息的代理:
NetNamedPipeBinding b = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
b.MaxConnections = 1000000;
EndpointAddress address = new EndpointAddress(@"net.pipe://sendmessage");
channelFactory = new ChannelFactory<ISendMessage>(b, address);
proxy = channelFactory.CreateChannel();
proxy.SendMessage("Hello, world.");
假设 SendMessage 函数有一个单向 OperationContract:
[OperationContract(IsOneWay=true)]
void SendMessage(string message);
运行这行代码是否proxy.SendMessage("Hello, world.");
保证将消息传递到服务器?如果不是默认情况下,有没有办法保证交货?假设我的应用程序崩溃了,它在proxy.SendMessage("Hello, world.");
运行后立即崩溃,假设没有网络故障,消息是否会发送到服务器?