Click here to Skip to main content
16,016,783 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem passing bitmap paths from C++ to .NET DLL Pin
Christian Graus11-Aug-05 14:49
protectorChristian Graus11-Aug-05 14:49 
GeneralRe: Problem passing bitmap paths from C++ to .NET DLL Pin
mpastchenko12-Aug-05 14:22
mpastchenko12-Aug-05 14:22 
GeneralPass message for the parent to handle Pin
DarkLizener11-Aug-05 12:50
DarkLizener11-Aug-05 12:50 
GeneraliSeries AS400 APIs Pin
Camron11-Aug-05 11:34
Camron11-Aug-05 11:34 
GeneralRe: iSeries AS400 APIs Pin
David Crow12-Aug-05 3:38
David Crow12-Aug-05 3:38 
GeneralRe: iSeries AS400 APIs Pin
Camron12-Aug-05 5:03
Camron12-Aug-05 5:03 
GeneralRe: iSeries AS400 APIs Pin
David Crow12-Aug-05 5:14
David Crow12-Aug-05 5:14 
Questionsend/recv help? Pin
KellyR11-Aug-05 10:55
KellyR11-Aug-05 10:55 
Hi and thanks!!

My problem is this:
I'm trying to send the bytes of a file from server to client via TCP packets, using a character array. I am using a CFile to read the file on server side, and write to it on client side.

I do this on server side:
CFile sourceFile;
char data[4096];

int read = sourceFile.Read(data, 4096);
send(clientsock,data,read, 0);

And on client side,
int ret = recv(serversock, message, messagelen, 0);

For some reason, although the 'read' int says it reads 738 bytes, which is correct, the 'data' character array only contains 4 bytes, the first four of the file. The client only receives the first 4 bytes also. What might I be doing wrong?

The file I'm sending is jpg image format.

Thanks a lot!

Kelly Ryan
AnswerRe: send/recv help? Pin
fakefur11-Aug-05 13:46
fakefur11-Aug-05 13:46 
GeneralRe: send/recv help? Pin
KellyR11-Aug-05 14:20
KellyR11-Aug-05 14:20 
GeneralRe: send/recv help? Pin
KellyR11-Aug-05 15:52
KellyR11-Aug-05 15:52 
GeneralRe: send/recv help? Pin
Jose Lamas Rios11-Aug-05 15:53
Jose Lamas Rios11-Aug-05 15:53 
GeneralPrevent CDialog activation. Pin
mintguy11-Aug-05 10:51
mintguy11-Aug-05 10:51 
GeneralRe: Prevent CDialog activation. Pin
Jose Lamas Rios11-Aug-05 15:39
Jose Lamas Rios11-Aug-05 15:39 
GeneralRe: Prevent CDialog activation. Pin
ThatsAlok11-Aug-05 18:26
ThatsAlok11-Aug-05 18:26 
GeneralRe: Prevent CDialog activation. Pin
mintguy11-Aug-05 20:21
mintguy11-Aug-05 20:21 
GeneralRe: Prevent CDialog activation. Pin
ThatsAlok11-Aug-05 20:34
ThatsAlok11-Aug-05 20:34 
GeneralRe: Prevent CDialog activation. Pin
mintguy11-Aug-05 20:56
mintguy11-Aug-05 20:56 
GeneralRe: Prevent CDialog activation. Pin
ThatsAlok11-Aug-05 22:45
ThatsAlok11-Aug-05 22:45 
GeneralRe: Prevent CDialog activation. Pin
mintguy11-Aug-05 20:23
mintguy11-Aug-05 20:23 
GeneralRe: Prevent CDialog activation. Pin
Jose Lamas Rios11-Aug-05 20:46
Jose Lamas Rios11-Aug-05 20:46 
GeneralRe: Prevent CDialog activation. Pin
mintguy11-Aug-05 20:54
mintguy11-Aug-05 20:54 
GeneralApplication crash due to change in compiler settings Pin
ComplexLifeForm11-Aug-05 10:01
ComplexLifeForm11-Aug-05 10:01 
GeneralRe: Application crash due to change in compiler settings Pin
geo_m13-Aug-05 21:58
geo_m13-Aug-05 21:58 
GeneralWaiting for a command to complete Pin
jet91511-Aug-05 8:46
jet91511-Aug-05 8:46 

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.