private void CliSend_Click(object sender, EventArgs e) { CliChatting.AppendText("Me : " + CliMessage.Text + "\r\n"); Writer.WriteLine(CliMessage.Text); // 보내버리기 Writer.Flush(); CliMessage.Clear(); }
private void ClientDevice_Load(object sender, EventArgs e) { String IP = "10.96.124.194"; // 접속 할 서버 아이피를 입력 int port = 8080; // 포트 Client = new TcpClient(); Client.Connect(IP, port); stream = Client.GetStream(); Connected = true; CliChatting.AppendText("Connected to Server!" + "\r\n"); Reader = new StreamReader(stream); Writer = new StreamWriter(stream); ReceiveThread = new Thread(new ThreadStart(Receive)); ReceiveThread.Start(); }