Well without knowing more about chatserver, as a class, Im going to guess it never was told to.. thats what debugging is for.
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
K, dont run the code in the load - because you arent threading it, the form will never show until you close the socket and end your chat server.
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
Define crashes - how? in what way? whats the message? what did debugging show you?
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
OK, so it hasnt crashed. Its in a loop, which is exactly what you told it to do.
Your thread code looks OK on face value.. does it do what you wanted is more important!
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
Well being in a thread it cant just write to your form, so Id have expected it to crash out and say so.
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190
I used a boolean flag, so I could do while (keeprunning) , that way I can set keeprunning to false outside the loop and the thread finishes cleanly.
LizR
Posting Virtuoso
1,791 posts since Aug 2008
Reputation Points: 196
Solved Threads: 190