Hey guys,
I’m getting a runtime exception on an AddHandler call that states that I’m attempting to add a handler when there’s already been one added already. Problem is, I can’t see where that is happening. Here’s my method where the error happens…
Sub InitializeSplashUploadSocket()
ImagePushSocket = New ConnectAndWriteSocket
ImagePushSocket.Address = IPAddress
ImagePushSocket.Port = 5000
ImagePushSocket.NetworkInterface = MyNIC
Try
AddHandler ImagePushSocket.SendProgress, WeakAddressOf UploadImageProgress
Catch
End Try
Try
AddHandler ImagePushSocket.QueueWriteComplete, WeakAddressOf UploadSplashComplete
Catch
End Try
Try
AddHandler ImagePushSocket.ConnectFailed, WeakAddressOf UploadSplashConnectFailed
Catch
End Try
Try
AddHandler ImagePushSocket.SendComplete, WeakAddressOf SplashImageUploadComplete
Catch
End Try
End Sub
The last AddHandler directive is where the exception occurs. The only other place where this handler could have been added is in the constructor of the socket. But that code is:
Sub Constructor()
ConnectCheckTimer = New Timer
ConnectCheckTimer.Mode = Timer.ModeOff
ConnectCheckTimer.Period = 1000
AddHandler ConnectCheckTimer.Action, WeakAddressOf ConnectCheckTimerAction
// Calling the overridden superclass constructor.
// Note that this may need modifications if there are multiple constructor choices.
// Possible constructor calls:
// Constructor() -- From TCPSocket
// Constructor() -- From SocketCore
Super.Constructor
End Sub
So I am stumped as to what is causing this error…
Is there any way in the debugger to determine the delegate for the event handler so I can see what method has already been assigned?