Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How Do I get message ON_UPDATE_COMMAND_UI for CButton Pin
фил7-Jan-04 4:26
фил7-Jan-04 4:26 
GeneralRe: How Do I get message ON_UPDATE_COMMAND_UI for CButton Pin
Prakash Nadar7-Jan-04 6:51
Prakash Nadar7-Jan-04 6:51 
Generalurl verifier Pin
murali_utr6-Jan-04 22:22
murali_utr6-Jan-04 22:22 
GeneralRe: url verifier Pin
David Crow7-Jan-04 2:36
David Crow7-Jan-04 2:36 
GeneralBlinking ListControl Items Pin
Meherman6-Jan-04 21:50
Meherman6-Jan-04 21:50 
GeneralRe: Blinking ListControl Items Pin
twing7-Jan-04 18:56
twing7-Jan-04 18:56 
GeneralCSocket problem Pin
y_seval6-Jan-04 21:46
y_seval6-Jan-04 21:46 
GeneralRe: CSocket problem Pin
Antti Keskinen7-Jan-04 1:28
Antti Keskinen7-Jan-04 1:28 
You should know, that the CSocket member is primarily used for absolute, defined network traffic, which happens in a synchronous, sequential order already outlined.

If you use asynchronous communication (a response from the server or a request from a client may arrive at any given time), you should derive your class from CAsyncSocket. This is the base class of CSocket and offers much greater flexibility, removing most of the automatic routines. Know, however, that asynchronous communication requires much more thought and design to be implemented properly.

As for the problem itself, make sure that the supporting thread is not terminated prematurely, and that you have specified the option for the client socket that you wish to handle received data notifications (See CAsyncSocket::OnReceive for details).

If these don't help, then the problem lies somewhere deeper. The socket object, by itself, is independent of where it is operated. That is, when the object is initialized properly, the framework (your computer) will notify the object that data is available or that data can be sent. The socket, as far as I can say based on the MSDN reference, is independent of the thread on which it is running.

But the main problem might be in the usage of CSocket instead of CAsyncSocket. Try implementing your program by using CAsyncSocket instead, and see how it works.

-Antti Keskinen


----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: CSocket problem Pin
Graham Bradshaw7-Jan-04 4:31
Graham Bradshaw7-Jan-04 4:31 
GeneralRe: CSocket problem Pin
Xiangyang Liu 刘向阳7-Jan-04 5:27
Xiangyang Liu 刘向阳7-Jan-04 5:27 
GeneralOutlook Express Pin
BaldwinMartin6-Jan-04 20:46
BaldwinMartin6-Jan-04 20:46 
GeneralRe: Outlook Express Pin
David Crow7-Jan-04 2:40
David Crow7-Jan-04 2:40 
GeneralRe: Outlook Express Pin
BaldwinMartin7-Jan-04 19:52
BaldwinMartin7-Jan-04 19:52 
GeneralRe: Outlook Express Pin
Joel Lucsy7-Jan-04 3:11
Joel Lucsy7-Jan-04 3:11 
GeneralRe: Outlook Express Pin
BaldwinMartin7-Jan-04 19:49
BaldwinMartin7-Jan-04 19:49 
GeneralSmall Help. Pin
Prakash Nadar6-Jan-04 20:41
Prakash Nadar6-Jan-04 20:41 
GeneralRe: Small Help. Pin
Antti Keskinen7-Jan-04 1:44
Antti Keskinen7-Jan-04 1:44 
GeneralRe: Small Help. Pin
shultas7-Jan-04 2:56
shultas7-Jan-04 2:56 
GeneralRe: Small Help. Pin
Prakash Nadar7-Jan-04 6:55
Prakash Nadar7-Jan-04 6:55 
GeneralRe: Small Help. Pin
shultas7-Jan-04 11:16
shultas7-Jan-04 11:16 
GeneralSetActiveView Pin
skylonely6-Jan-04 20:29
skylonely6-Jan-04 20:29 
GeneralRe: SetActiveView Pin
morefalt6-Jan-04 23:32
morefalt6-Jan-04 23:32 
GeneralCFileDialog - Open Dialog Pin
murali_utr6-Jan-04 20:21
murali_utr6-Jan-04 20:21 
GeneralRe: CFileDialog - Open Dialog Pin
BaldwinMartin6-Jan-04 21:08
BaldwinMartin6-Jan-04 21:08 
GeneralRe: CFileDialog - Open Dialog Pin
shultas7-Jan-04 2:14
shultas7-Jan-04 2:14 

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.