void _service_ServerConnectionFailed(object sender, EventArgs e) { if (ServerConnectionFailed != null) { _service = null; _host = null; ServerConnectionFailed(sender, e); } LoggedIn = false; }
internal void StartHost() { if (_service != null) return; _host = new ServiceHost(); _service = new ChatroomClientService(TermReceived); _service.ServerConnectionFailed += new EventHandler(_service_ServerConnectionFailed); _host.AddService(_service); _host.StartServiceHost(); _host.OpenServices(); _hostStarted = true; }
internal void StopHost() { if (_service == null) return; _host.CloseServices(); _host.StopServiceHost(); HostStarted = false; LoggedIn = false; _service = null; }
static void Main(string[] args) { ServiceHost host = new ServiceHost(); ChatroomClientService service = new ChatroomClientService(); }