Exemplo n.º 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;
        }
Exemplo n.º 2
0
        public static WCFTcpServer GetInstance()
        {
            if (Instance == null)
            {
                Instance = new WCFTcpServer();
            }

            return(Instance);
        }
Exemplo n.º 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;
            }
        }
Exemplo n.º 4
0
 private void buttonSend_Click(object sender, EventArgs e)
 {
     //WCFTcpServer.GetInstance().BrodCast(textBoxMessage.Text);
     WCFTcpServer.GetInstance().BrodCastMessage(WCFMessageKind.Message, textBoxMessage.Text);
 }
Exemplo n.º 5
0
 ////클라이언트들을 모을 배열이다.
 private WCFTcpServer()
 {
     Instance = this;
 }