Currently my GUI is Freezing when I try to display data I read from my socket. It's not freezing when i display one, or two messages, only when I receive many messages(2-3 per sec). I am using async socket(non blocking). I guess it's related to how I display the data to the gui. Code:
public class Globals
{
public static MainDialog myDialog;
}
public partial class MainDialog : Form
{
public MainDialog()
{
InitializeComponent();
Globals.myDialog = this;
}
public void sendText(string text)
{
logBox.AppendText(text);
logBox.AppendText("\n");
}
}
Then I simply call Globals.myDialog.sendText(..) from my network class. As I said it works fine, but not when I receive many messages at once.
Anyone have an Idea?