|
-
Sep 1st, 2002, 06:43 AM
#1
Thread Starter
Junior Member
Threading and the timer, problem.
I have created a UDP sockets class. But theres a fundamental flaw in the class.
When the UDPclient is listening for a reply from the server it hangs my program if no reply is sent. I got over this by running the udpsend in another thread. Great but now I have a thread that needs killing. I thought of using the timer the kill the thread if it didnt repond in the alloted time, but apparently timers only work in a single threaded environment.
Has anyone got any suggestions of how to get around this problem?
Strange to think that with VB6 this task was done easily within 5 mins (this is my 3rd day in VB.NET!
Imogen
PS before you suggest using a TCP client server with a definite connection state, I cant the server is pre-written and I do not have the source code to authority to change it.
Also I could use the VB6 OCX to achieve the desired result... but feel I shouldnt have to, should I be able to do it just as well (if not better in .NET)
-
Sep 2nd, 2002, 02:58 AM
#2
Addicted Member
Have a look in <FrameworkSDK>\Samples\Technologies\Threading\Timers
There is a example which may help.
Wind and waves resolves all problems.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|