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