예제 #1
0
        void _service_ServerConnectionFailed(object sender, EventArgs e)
        {
            if (ServerConnectionFailed != null)
            {
                _service = null;
                _host = null;
                ServerConnectionFailed(sender, e);
            }

            LoggedIn = false;
        }
예제 #2
0
        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;
        }
예제 #3
0
        internal void StopHost()
        {
            if (_service == null) return;

            _host.CloseServices();
            _host.StopServiceHost();

            HostStarted = false;

            LoggedIn = false;

            _service = null;
        }
예제 #4
0
        static void Main(string[] args)
        {
            ServiceHost host = new ServiceHost();

            ChatroomClientService service = new ChatroomClientService();
        }