1

I have C# winform being tcp server. the message receiving function runs with backgroundworker.

My winform will display a datagridview, which links to a bindingList of Objects like:

ClientObject {
    public string id { get; set; }
    public string name { get; set; }
    public string ip { get; set; }
    public int port { get; set; }
}

And when the server receives message, it will update the bindingList sometimes, and refresh the datagridview. My problem is, the winform sometimes hangs, and when I run the winform with debug mode in Visual Studio, the backgroundworker is still running.

Does the update bindingList part causes the winform to hang? Should I use mutex or something when I update the bindingList?

Thanks for help.

PS. I have Control.CheckForIllegalCrossThreadCalls = false; at the beginning

AkariKamigishi
  • 277
  • 7
  • 23

0 Answers0