Пример #1
0
        private void WCFTcpServerForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            WCFTcpServer.GetInstance().BrodCastMessage(WCFMessageKind.State, CommunicationState.Closed.ToString());
            serviceHost.Close(new TimeSpan(0, 0, 0, 0, 10));

            timerPoll.Enabled = false;
        }
Пример #2
0
        public static WCFTcpServer GetInstance()
        {
            if (Instance == null)
            {
                Instance = new WCFTcpServer();
            }

            return(Instance);
        }
Пример #3
0
        private void buttonClose_Click(object sender, EventArgs e)
        {
            switch (serviceHost.State)
            {
            case CommunicationState.Opened:
                WCFTcpServer.GetInstance().BrodCastMessage(WCFMessageKind.State, CommunicationState.Closed.ToString());
                serviceHost.Close(new TimeSpan(0, 0, 0, 0, 10));

                timerPoll.Enabled = false;
                return;
            }
        }
Пример #4
0
 private void buttonSend_Click(object sender, EventArgs e)
 {
     //WCFTcpServer.GetInstance().BrodCast(textBoxMessage.Text);
     WCFTcpServer.GetInstance().BrodCastMessage(WCFMessageKind.Message, textBoxMessage.Text);
 }
Пример #5
0
 ////클라이언트들을 모을 배열이다.
 private WCFTcpServer()
 {
     Instance = this;
 }