المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Networking problems.



C# Programming
09-08-2009, 11:24 PM
Hello,
I have been working on a new project of a newtork game by this method:
http://www.codeproject.com/KB/game/eatergame.aspx

I was trying to create a trivia game including 4 answer and 15 second to answer each one. for that

I have created a Question class.
The problem started While I had to create a shared time(to make sure all the clients will have the

same time as the server) so I used an extra listening thread in the Question class(it comes from

showdialog());

Everything works fine , until the 4th,5th question (something the 3rd) when the Question class

(which is a form by itself) loads too slow (like 10 sec) when the timer is already done.

I was thinking to create a Show() method instead of ShowDialog and use the Server class but it

won't work because of multithreading(It's stuck).

I would like to add I used two function I saw in net:
"threadname".abort()
"threadname".join()

also I tried to give the Question variable (which created each time in a thread) a null value and use

GC.collect()

I'm stuck , I hope someone can help me(if something isn't clear I can send you the SLN (source)

file).

Thanks alot!