|
-
Jul 13th, 2004, 08:51 PM
#1
Thread Starter
New Member
Threading, Classes, Events?
I'm having problems intercepting events from a class running under multiple threads.
'------------- BEGIN CODE -----------
Public withevents Protocol as clsProtocol
....
.....
.....
dim t as Thread
For i = 0 to servers.count
Protocol = new clsProtocol(servers(i))
t = new Thread(AddressOf Protocol.Query)
t.start()
Thread.Sleep(0)
next i
.......
.....
.......
Private Sub Protocol_TimeOut(byref p as clsProtocol) Handles Protocol.TimeOut
....
....
.....
End Sub
'-------------------------------------------
Essentially the problem is that out of 3 server instances that raise the event only the last instance actually is caught by the handler. I have no idea why or how to work around this problem....
If this is a bit vague I can elaborate.
Cheers,
Tom
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
|