Click here to Skip to main content
15,896,727 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Learning VS 2005 C++ - recommendation Pin
Rolf Kristensen10-Jan-10 1:59
Rolf Kristensen10-Jan-10 1:59 
AnswerRe: Learning VS 2005 C++ - recommendation Pin
Denny10110-Jan-10 20:28
Denny10110-Jan-10 20:28 
GeneralRe: Learning VS 2005 C++ - recommendation Pin
Rolf Kristensen15-Jan-10 1:20
Rolf Kristensen15-Jan-10 1:20 
GeneralRe: Learning VS 2005 C++ - recommendation Pin
Denny10115-Jan-10 9:32
Denny10115-Jan-10 9:32 
QuestionWSAAsyncSelect and FD_WRITE Pin
zoopp9-Jan-10 0:35
zoopp9-Jan-10 0:35 
AnswerRe: WSAAsyncSelect and FD_WRITE Pin
Moak9-Jan-10 5:50
Moak9-Jan-10 5:50 
GeneralRe: WSAAsyncSelect and FD_WRITE Pin
zoopp9-Jan-10 11:18
zoopp9-Jan-10 11:18 
GeneralRe: WSAAsyncSelect and FD_WRITE Pin
Moak9-Jan-10 12:00
Moak9-Jan-10 12:00 
zoopp wrote:
You said that FD_WRITE is used for handling partial sends but, according to MSDN, it will also trigger after a call to connect() or accept().


MSDN can be misleading, you can use it as a reference but it's an epic fail as a tutorial! The FD_WRITE event will also be fired once a client connects. You can interpret it as a "now it is the first time to send data", but it must not be confused with e.g. FD_CONNECT which signals when a client is connected. Check MSDN[^] where it says "Here is a summary of events and conditions for each asynchronous notification message", it describes the different meanings each event may have. Here is a simplified overview of the corresponding events:

* FD_READ informs when (more) data can be received
* FD_WRITE informs when (more) data can be send
* FD_ACCEPT informs when incoming socket is waiting at listening socket, server side only
* FD_CONNECT informs when socket has been connected or attempt failed, client side only

Okay, to answer your question, I would not disable FD_WRITE before connecting and instead let the application logic decide how it handles the event (you can always ignore it when there is no data to be sent). Let me suggest two more things, have a look at Effective TCP/IP Programming: 44 Tips to Improve Your Network Programs[^] (really can recommend to buy it) and maybe join the webchat in the link below.

Hope this helps Smile | :)
/M


QuestionHow to check if a tree is AVL tree? Pin
Cowork8-Jan-10 22:17
Cowork8-Jan-10 22:17 
QuestionRe: How to check if a tree is AVL tree? Pin
CPallini9-Jan-10 4:42
mveCPallini9-Jan-10 4:42 
AnswerRe: How to check if a tree is AVL tree? Pin
Cowork9-Jan-10 13:50
Cowork9-Jan-10 13:50 
GeneralRe: How to check if a tree is AVL tree? Pin
CPallini9-Jan-10 22:50
mveCPallini9-Jan-10 22:50 
AnswerRe: How to check if a tree is AVL tree? Pin
Saurabh.Garg9-Jan-10 14:30
Saurabh.Garg9-Jan-10 14:30 
Questionregular expression library for win32 api c or c++ Pin
Jayapal Chandran8-Jan-10 7:55
Jayapal Chandran8-Jan-10 7:55 
AnswerRe: regular expression library for win32 api c or c++ Pin
LunaticFringe8-Jan-10 8:57
LunaticFringe8-Jan-10 8:57 
GeneralRe: regular expression library for win32 api c or c++ Pin
Jayapal Chandran9-Jan-10 5:37
Jayapal Chandran9-Jan-10 5:37 
GeneralRe: regular expression library for win32 api c or c++ Pin
LunaticFringe9-Jan-10 11:56
LunaticFringe9-Jan-10 11:56 
GeneralRe: regular expression library for win32 api c or c++ Pin
Jayapal Chandran10-Jan-10 8:14
Jayapal Chandran10-Jan-10 8:14 
AnswerRe: regular expression library for win32 api c or c++ Pin
Graham Shanks8-Jan-10 10:39
Graham Shanks8-Jan-10 10:39 
AnswerRe: regular expression library for win32 api c or c++ Pin
Nemanja Trifunovic8-Jan-10 12:07
Nemanja Trifunovic8-Jan-10 12:07 
GeneralRe: regular expression library for win32 api c or c++ Pin
Jayapal Chandran9-Jan-10 5:39
Jayapal Chandran9-Jan-10 5:39 
QuestionQuestion about reading and writing to a file Pin
amichai228-Jan-10 6:25
amichai228-Jan-10 6:25 
AnswerRe: Question about reading and writing to a file PinPopular
amichai228-Jan-10 6:28
amichai228-Jan-10 6:28 
GeneralRe: Question about reading and writing to a file Pin
Nelek8-Jan-10 6:38
protectorNelek8-Jan-10 6:38 
Questionstring array Pin
CODEPC8-Jan-10 5:08
CODEPC8-Jan-10 5:08 

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.