|
-
Dec 27th, 2002, 06:05 PM
#1
Thread Starter
Addicted Member
a bit of a dilema with many sockets, threads, windows messages, and MFC
I'm making a network analyzer / Administration tool and one of the features that im working on is a port scanner. Im tryin to make it really fast so i made a thread and my own CMySock class derived from CAsyncSocket. In the thread i declare a large array of these sockets and then have a loop in which they all try to connect to their assigned port. Then when they do connect the OnConnect function is called. The main problem is that the OnConnect functions are not being called for the sockets until the loop ends. And only if I put a MessageBox at the end of the loop before the end of the thread, if i do not put the messagebox there then the thread will return and the sockets will go out of scope. However it works fine if i put a messagebox in the loop except i obviously cant do this. It seems like the main problem is that the loop doesnt allow time for windows to process the messages. Is there any way i can make it so that the loop allows time for windows to process all of the messages?
Thx in advance.
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
|