-
Sockets & Delegates. . .
Well i am developing a bot that will download files from IRC and i am facing some problems that you might help me resolve.
Before is tarted this IRC bot thing i had to design my own socket class and i did it through async delegates(instead of using threading).
This raises me a BIG problem. If I try to connect to a wrong ip or something that would raise a bug when using async callbacks instead of raising the error in the line of code of the Connect() method it will raise it anywhere in the app(in the Application.Run(new MainFrm()) most of the times). Is there any work-around against this?
I really hope I made myself clear otherwise just state it and I'll try to explain things better :wave:
-
I would think a Try...Catch...Finally would deal with that wouldn't it?
Phreak
-
That's what I'm saying, as when the delegate raises the error the code flow will not be anymore in the function that executed the Connect() but will be in the Application.Run(new MainFrm()) so putting the Try/catch thing won't resolve anything :o