error when again press button in xamrain c#>>>THIS CODE | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

error when again press button in xamrain c#>>>THIS CODE

button = FindViewById<Button>(Resource.Id.button1); button.Click += delegate { string textToSend = "hi"; //---create a TCPClient object at the IP and port no.--- TcpClient client = new TcpClient("192.168.1.8", 5555); NetworkStream nwStream = client.GetStream(); byte[] bytesToSend = ASCIIEncoding.ASCII.GetBytes(textToSend); //---send the text--- nwStream.Write(bytesToSend, 0, bytesToSend.Length); //---read back the text--- client.Close(); nwStream.Close(); };

21st Oct 2018, 2:29 PM
ALAMOUDI, WAEL MAKKI S
ALAMOUDI, WAEL MAKKI S - avatar
1 Answer
+ 1
what is description of the error, you have? I think, stream no closing
22nd Oct 2018, 12:32 AM
Александр Лебедев
Александр Лебедев - avatar