The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: ctt on November 28, 2007, 09:11:31 AM

Title: wsock in console
Post by: ctt on November 28, 2007, 09:11:31 AM
Hello everyone!

Maybe im just plain stupid (prolly this is the case) but i can't figure out how to handle the events of wsock when im doing application in console.
In every example i've seen it's always WndProc, DlgProc, etc... but what routine is used in console?
If i want to wait for a FD_CONNECT for instance, how do I do that?
Title: Re: wsock in console
Post by: Vektor on November 28, 2007, 09:16:21 AM
Use WSACreateEvent / WSAEventSelect / WSAWaitForMultipleEvents / WSAEnumNetworkEvents .
Title: Re: wsock in console
Post by: akane on November 28, 2007, 10:02:59 AM
Console app does not restrict you from creating windows. You can create your own window/dialog, or use a hidden, subclassed tooltip window, so you will be able to use WSAAsyncSelect. It works well :)