clientService = new ServiceHost(typeof(ClientEvents)); clientService.AddServiceEndpoint(typeof(ChatService.IClientEvents), tcpbind, myHost); clientService.Open();
ChatService.IClientEvents usrcbChnl = OperationContext.Currect.GetCallbackChannel<ChatService.IClientEvents>();
callbacks.Add(usr, new ClientEvents()); // callbacks is a dictionary that holds new user connections and their callback NetTcpBinding tcpbind = new NetTcpBinding(); tcpbind.Security.Mode = SecurityMode.None; ChatService.IClientEvents frCb = DuplexChannelFactory.CreateChannel(this.callbacks[usr], tcpbind, new EndpointAddress(usr.PeerHost));