Click here to Skip to main content
15,919,358 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: modeless dialogs - ownmessage queue ? Pin
Diddy27-Jan-04 0:11
Diddy27-Jan-04 0:11 
GeneralRe: modeless dialogs - ownmessage queue ? Pin
rrrado27-Jan-04 0:47
rrrado27-Jan-04 0:47 
QuestionHow to get CurrentDir of an application running in Embedded Visual C? Pin
ntnhan26-Jan-04 21:31
ntnhan26-Jan-04 21:31 
AnswerRe: How to get CurrentDir of an application running in Embedded Visual C? Pin
Michael P Butler27-Jan-04 1:57
Michael P Butler27-Jan-04 1:57 
GeneralUtility for checking dependencies Pin
rajeev26-Jan-04 21:31
rajeev26-Jan-04 21:31 
Generalmemory leak debugger Pin
Gérald Mercet26-Jan-04 21:16
Gérald Mercet26-Jan-04 21:16 
GeneralRe: memory leak debugger Pin
J. Eric Vaughan27-Jan-04 3:16
J. Eric Vaughan27-Jan-04 3:16 
Generaldifference between CSocket and CAsynSocket Recieve Call Pin
Atif Mushtaq26-Jan-04 20:20
Atif Mushtaq26-Jan-04 20:20 
What is the difference between CSocket and CAsyncSocket

Accrding to MSDN CSocket is a blocking socket and CAsynSocket is a non blocking socket from it what i understood that for example if u make a call on CSocket Recieve it will not return untill u get the whole data (which is wrong when data is on average > 5 k u have to make multiple recieve call to fetch the whole data)
but in case of CAsyncSocket u will have to loop to get whole data .

but another joke written in MSDN is that one should not make multiple recieve calls in OnRecieve while using CSocket::Recieve cauz CSocket is internally dooing looping to recieve whole data.
but with single call u cannot get the whole data atonce. so result of it's is that CSocket becomes useless after transferring 40 , 50 k data on average.


so can anybody explain this scneriao . what is the best way to recieve data in OnRecieve and what socket should i use CSocket or CAsyncSocket.

Note:i am writing a Video streaming software so server on average sends me data range from 5 to 15 k /sec .what i do in OnRecieve is asfollows
do//i am using CSocket
{
res=Receive(ptr,lLength);//where ptr is buffer of size of incoming data
if(res==SOCKET_ERROR)
{
Close();
break;
}
ptr+=res;
total+=res;
}

while(total<lLength);//lLength is size of incoming data


in this case according to msdn i am making multiple recieve call which is wrong , but the reason for it is that i am not able to recieve whold data with one Recive call .
but the result of this code is that it works for hardly 10 to 12 frames. and i have to reconnect again.


No Worries!
GeneralRe: difference between CSocket and CAsynSocket Recieve Call Pin
RobJones27-Jan-04 3:03
RobJones27-Jan-04 3:03 
GeneralRe: difference between CSocket and CAsynSocket Recieve Call Pin
Atif Mushtaq27-Jan-04 18:16
Atif Mushtaq27-Jan-04 18:16 
GeneralRe: difference between CSocket and CAsynSocket Recieve Call Pin
RobJones28-Jan-04 3:04
RobJones28-Jan-04 3:04 
GeneralRe: difference between CSocket and CAsynSocket Recieve Call Pin
RobJones28-Jan-04 3:59
RobJones28-Jan-04 3:59 
GeneralRe: difference between CSocket and CAsynSocket Recieve Call Pin
Atif Mushtaq28-Jan-04 5:16
Atif Mushtaq28-Jan-04 5:16 
GeneralRe: difference between CSocket and CAsynSocket Recieve Call Pin
Xiangyang Liu 刘向阳28-Jan-04 7:02
Xiangyang Liu 刘向阳28-Jan-04 7:02 
GeneralWindows hooks Pin
Abhi Lahare26-Jan-04 18:43
Abhi Lahare26-Jan-04 18:43 
GeneralEdit boxes Pin
calebcohoon26-Jan-04 17:18
calebcohoon26-Jan-04 17:18 
GeneralRe: Edit boxes Pin
P-Rex26-Jan-04 20:59
P-Rex26-Jan-04 20:59 
GeneralRe: Edit boxes Pin
Robert A. T. Káldy27-Jan-04 0:24
Robert A. T. Káldy27-Jan-04 0:24 
GeneralRe: Edit boxes Pin
calebcohoon27-Jan-04 5:40
calebcohoon27-Jan-04 5:40 
GeneralFinding version info of a DLL Pin
haritadala26-Jan-04 17:13
haritadala26-Jan-04 17:13 
GeneralRe: Finding version info of a DLL Pin
Tim Smith26-Jan-04 17:26
Tim Smith26-Jan-04 17:26 
GeneralRe: Finding version info of a DLL Pin
Anonymous26-Jan-04 17:29
Anonymous26-Jan-04 17:29 
GeneralRe: Finding version info of a DLL Pin
haritadala27-Jan-04 3:51
haritadala27-Jan-04 3:51 
GeneralRe: Finding version info of a DLL Pin
Tim Smith27-Jan-04 4:18
Tim Smith27-Jan-04 4:18 
GeneralSendKey Pin
BaldwinMartin26-Jan-04 16:28
BaldwinMartin26-Jan-04 16:28 

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.