J
jm
Easy probably, please read on. I know some of you have commented
already about some of my socket question. I appreciate that.
I have a Form1:
static void Main()
{
Application.Run(new Form1());
clsListening.AsynchronousSocketListener.StartListening();
}
In the clsListening below is the code. It is all straight from MSDN.
The problem is this:
If I run this the Form will load, but the the next line will not
execute until the form Form1 is closed (I just hit the X.) I know
this is true because netstat -a | find "8002" reveals it is not
listenting. Close the form and voila it is listening.
I do not understand why it is doing this. Please help me understand
this behavior. BTW, the listener and all works, I have to have the
form running because I need an icon in the system tray.
Also, if I reverse the two the Form1 will never run, because of the
While(true) for the listener (at least I think that is why.)
I just want the listener to run and the form to run:
I thought I would try this, but it failed with the same results,
except the Form1 never ran:
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
clsListening.AsynchronousSocketListener.StartListening();
}
The slight difference here was that the icon was in the system tray,
but the form was not visible! Thank you for any help here.
already about some of my socket question. I appreciate that.
I have a Form1:
static void Main()
{
Application.Run(new Form1());
clsListening.AsynchronousSocketListener.StartListening();
}
In the clsListening below is the code. It is all straight from MSDN.
The problem is this:
If I run this the Form will load, but the the next line will not
execute until the form Form1 is closed (I just hit the X.) I know
this is true because netstat -a | find "8002" reveals it is not
listenting. Close the form and voila it is listening.
I do not understand why it is doing this. Please help me understand
this behavior. BTW, the listener and all works, I have to have the
form running because I need an icon in the system tray.
Also, if I reverse the two the Form1 will never run, because of the
While(true) for the listener (at least I think that is why.)
I just want the listener to run and the form to run:
I thought I would try this, but it failed with the same results,
except the Form1 never ran:
static void Main()
{
Application.Run(new Form1());
}
private void Form1_Load(object sender, System.EventArgs e)
{
clsListening.AsynchronousSocketListener.StartListening();
}
The slight difference here was that the icon was in the system tray,
but the form was not visible! Thank you for any help here.