Click here to Skip to main content
15,918,243 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCException vs.net 2003 Pin
Thomas Andersen19-Sep-03 19:49
Thomas Andersen19-Sep-03 19:49 
QuestionHow to centralized a bitmap Pin
Boby.George19-Sep-03 19:01
professionalBoby.George19-Sep-03 19:01 
AnswerRe: How to centralized a bitmap Pin
alex.barylski20-Sep-03 4:55
alex.barylski20-Sep-03 4:55 
GeneralBCGControlBar vs. CodeJock XTreme Toolkit Pin
Joe Woodbury19-Sep-03 18:59
professionalJoe Woodbury19-Sep-03 18:59 
GeneralRe: BCGControlBar vs. CodeJock XTreme Toolkit Pin
Taka Muraoka19-Sep-03 23:29
Taka Muraoka19-Sep-03 23:29 
GeneralUDP Sample Program Pin
Ilamparithi19-Sep-03 18:54
Ilamparithi19-Sep-03 18:54 
GeneralRe: UDP Sample Program Pin
Rickard Andersson2020-Sep-03 2:15
Rickard Andersson2020-Sep-03 2:15 
GeneralData sending problem in CSocket Pin
Jegan Sasi19-Sep-03 18:50
Jegan Sasi19-Sep-03 18:50 
Hi All!

I am developing application like Instant Messenger(Chat application) in VC++ using CSocket class. The problem I found is when I send the data continuosly using for loop(For example 10 packets), only 2 packets are received in client.

It means that the socket is still processing the data. So the next packet can not be transferred untill the previous transction comes to end. If I use sleep function between every data transmission, it is perfect, but it is so slow in network application

Code (Data lossing)

for(int i=0;i<10;i++)
Socket.Send(Data,sizeof(Data));

Code (Working,but slow)

for(int i=0;i<10;i++)
{
Socket.Send(Data,sizeof(Data));
Sleeep(200);
}

Please understand that I do not know size of sending data. becuase in chat application, size of data depends on the text the user typed.

Send() does not return number of bytes sent actually

OnReceive() will not return error value. It recieves only two packets for 10 packets sending
OnReceive() is executed 2 times not 10 times to check the return value ok.
Multithreading conecpt will come only if you want to accept one more client, not receiving data from one client
If you have idea about this topic please send the mail to mailto:itjegan@sify.com
GeneralRe: Data sending problem in CSocket Pin
Luis Mejia20-Sep-03 10:42
Luis Mejia20-Sep-03 10:42 
GeneralHotkey combinations Pin
ironhead19-Sep-03 17:59
ironhead19-Sep-03 17:59 
GeneralShellExecute Pin
hemanheman19-Sep-03 15:47
hemanheman19-Sep-03 15:47 
GeneralRebar and Toolbars Pin
fgabrieli19-Sep-03 11:30
fgabrieli19-Sep-03 11:30 
GeneralFont dialog problems Pin
halblonious19-Sep-03 11:12
halblonious19-Sep-03 11:12 
Generalperformance question Pin
Gary Kirkham19-Sep-03 10:59
Gary Kirkham19-Sep-03 10:59 
GeneralRe: performance question Pin
Joe Woodbury19-Sep-03 12:35
professionalJoe Woodbury19-Sep-03 12:35 
GeneralRe: performance question Pin
Tim Smith19-Sep-03 12:40
Tim Smith19-Sep-03 12:40 
GeneralRe: performance question Pin
Gary Kirkham19-Sep-03 13:26
Gary Kirkham19-Sep-03 13:26 
GeneralRe: performance question Pin
Gary R. Wheeler20-Sep-03 3:28
Gary R. Wheeler20-Sep-03 3:28 
GeneralRe: performance question Pin
Gary Kirkham20-Sep-03 11:52
Gary Kirkham20-Sep-03 11:52 
GeneralRe: performance question Pin
Gary R. Wheeler20-Sep-03 14:13
Gary R. Wheeler20-Sep-03 14:13 
Generalpassing data structures Pin
Sirrius19-Sep-03 10:36
Sirrius19-Sep-03 10:36 
GeneralRe: passing data structures Pin
Michael Dunn19-Sep-03 11:11
sitebuilderMichael Dunn19-Sep-03 11:11 
GeneralRe: passing data structures Pin
Sirrius19-Sep-03 14:36
Sirrius19-Sep-03 14:36 
GeneralRe: passing data structures Pin
Sirrius19-Sep-03 13:00
Sirrius19-Sep-03 13:00 
GeneralWord wrap in Rich Edit and multiline edit Pin
insanely42019-Sep-03 9:07
insanely42019-Sep-03 9:07 

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.