Ang619
❔ my socket changes his connected attribute to false right after i sucessfully received data :(
Hello community, i am writing a chatroom application, where i wrote a Task to receive messages. However, after i sucessfully received the first data, the socket changes his connected attribute to false, and my application stops.
I wonder why this happens, and i also dont understand why i dont get thrown into the Catch block, and instead the application closes.
The connected attribute changes to false immediately after the receiveAsync is sucessfully executed, at the begining of the Task.
On the second round of the while loop, my application closes at the receiveAsync line.
The Task is some lines, so i uploaded the code here: https://codeshare.io/6pZjop
I appreciate any help.
11 replies