0
我遇到了一個wcf客戶端 - 服務器聊天應用程序的例子。爲什麼在一個wcf聊天應用程序中使用會話
[ServiceContract(CallbackContract=typeof(ISampleChatCallback), SessionMode=SessionMode.Required)]
public interface ISampleChat
{
[OperationContract(IsInitiating=true, IsOneWay=true)]
void Connect(string name);
[OperationContract(IsOneWay = true)]
void SayToServer(string name, string msg);
[OperationContract(IsTerminating = true, IsOneWay = true)]
void Disconnect(string name);
}
我試圖理解爲什麼我需要在聊天應用程序會話? (它在服務器上執行什麼重要的作用)
它使用NetTcpBinding的 – 2012-02-01 20:05:07
所以你不需要會話然後 – 2012-02-01 21:42:42
我使用NetTcpBinding的默認值是SessionMode.Allowed 和InstanceContextMode.PerSession 所以用nettcpbindings工作時它隨着季節的作品時,請閱讀O'Reillys學習WCF 如果我們在哪裏溝通(不同的綁定)一些其他方式,它會在perCall基礎上溝通 。從上面的代碼看來它是基於雙工連接的 – 2012-02-01 22:51:51