Click here to Skip to main content
15,890,336 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Bitblt Transparency question Pin
ForNow6-Jun-10 17:42
ForNow6-Jun-10 17:42 
GeneralRe: Bitblt Transparency question Pin
Niklas L6-Jun-10 20:48
Niklas L6-Jun-10 20:48 
GeneralRe: Bitblt Transparency question Pin
ForNow7-Jun-10 2:27
ForNow7-Jun-10 2:27 
QuestionAsynchronous sockets Pin
onyxbird5-Jun-10 19:06
onyxbird5-Jun-10 19:06 
AnswerRe: Asynchronous sockets Pin
Aescleal5-Jun-10 19:36
Aescleal5-Jun-10 19:36 
AnswerRe: Asynchronous sockets Pin
Moak6-Jun-10 8:06
Moak6-Jun-10 8:06 
GeneralRe: Asynchronous sockets Pin
onyxbird6-Jun-10 8:21
onyxbird6-Jun-10 8:21 
GeneralRe: Asynchronous sockets Pin
Moak6-Jun-10 10:13
Moak6-Jun-10 10:13 
Here is the theory: An asynchronous server will notify you when something interesting happens, e.g. about a new incoming connection, when data could be sent, or data could be received on a socket. So you do not have to to start a new thread for every incoming client connection. Instead you can handle many sockets within a single thread context, on Windows for example WSAAsyncSelect[^] will notify you if any of your socket status changes (see FD_READ and FD_WRITE).

Here are two practical examples with source code:
- Programming Windows TCP Sockets in C++ for the Beginner[^]
- CAsyncSocketEx - Replacement for CAsyncSocket with proxy and SSL support[^]

Btw, there are also a couple of C++ network libraries with asynchronous sockets. You sounded like you wanted to implement it on you own, so just wanted to let you know that there are working solutions.

Happy coding Smile | :)
/M

Chat in Europe Java | [Coffee] Now with 24% more Twitter


GeneralRe: Asynchronous sockets Pin
onyxbird7-Jun-10 12:02
onyxbird7-Jun-10 12:02 
AnswerRe: Asynchronous sockets Pin
Mauro Leggieri6-Jun-10 9:11
Mauro Leggieri6-Jun-10 9:11 
GeneralRe: Asynchronous sockets Pin
onyxbird7-Jun-10 12:03
onyxbird7-Jun-10 12:03 
QuestionHow to Save Picture(Image) Pin
voo doo125-Jun-10 15:44
voo doo125-Jun-10 15:44 
AnswerRe: How to Save Picture(Image) [modified] Pin
Niklas L6-Jun-10 9:51
Niklas L6-Jun-10 9:51 
GeneralRe: How to Save Picture(Image) Pin
voo doo127-Jun-10 2:53
voo doo127-Jun-10 2:53 
GeneralRe: How to Save Picture(Image) Pin
Niklas L7-Jun-10 3:57
Niklas L7-Jun-10 3:57 
Questionhow to paint a bitmap to the dialog client dc from the memory dc Pin
Krauze5-Jun-10 14:54
Krauze5-Jun-10 14:54 
AnswerRe: how to paint a bitmap to the dialog client dc from the memory dc Pin
Niklas L6-Jun-10 11:15
Niklas L6-Jun-10 11:15 
QuestionHow to overlay Direct3d model in live webcam feed Pin
GreenGiant835-Jun-10 8:58
GreenGiant835-Jun-10 8:58 
QuestionHelp with hash tables in C Pin
arnluci5-Jun-10 6:48
arnluci5-Jun-10 6:48 
AnswerRe: Help with hash tables in C Pin
Luc Pattyn5-Jun-10 8:10
sitebuilderLuc Pattyn5-Jun-10 8:10 
GeneralRe: Help with hash tables in C Pin
arnluci5-Jun-10 11:09
arnluci5-Jun-10 11:09 
GeneralRe: Help with hash tables in C Pin
Luc Pattyn5-Jun-10 11:31
sitebuilderLuc Pattyn5-Jun-10 11:31 
GeneralRe: Help with hash tables in C Pin
Saurabh.Garg6-Jun-10 2:16
Saurabh.Garg6-Jun-10 2:16 
GeneralRe: Help with hash tables in C [modified] Pin
arnluci21-Jun-10 10:31
arnluci21-Jun-10 10:31 
Questionwhy does it use so many memory [modified][Solved] Pin
yu-jian5-Jun-10 5:25
yu-jian5-Jun-10 5:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.