Click here to Skip to main content
15,913,669 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generaldebugger problem Pin
User 58385211-Jan-04 9:55
User 58385211-Jan-04 9:55 
GeneralRe: debugger problem Pin
Roger Allen12-Jan-04 0:45
Roger Allen12-Jan-04 0:45 
GeneralWhen should I delete ServerSocket when client shutdown Pin
white jungle11-Jan-04 5:21
white jungle11-Jan-04 5:21 
GeneralRe: When should I delete ServerSocket when client shutdown Pin
valikac11-Jan-04 6:03
valikac11-Jan-04 6:03 
GeneralRe: When should I delete ServerSocket when client shutdown Pin
white jungle11-Jan-04 6:59
white jungle11-Jan-04 6:59 
GeneralLV & TV strange behavior Pin
GeraldoLuiz11-Jan-04 1:49
GeraldoLuiz11-Jan-04 1:49 
GeneralRe: LV & TV strange behavior Pin
GeraldoLuiz11-Jan-04 11:49
GeraldoLuiz11-Jan-04 11:49 
Generalc++ file transfer between client\server Pin
Anonymous11-Jan-04 1:33
Anonymous11-Jan-04 1:33 
hello
iv created my self a frustrating problemb that i just cant seem to resolve,i can think of so many potential problembs that could be rendering my code useless i just dont know where to start!

okay im trying to send a .exe file between my client and server,the file is recived by the client but only 11 bytes or so is actually transfered,i think the problemb could be with how i got my socket's set up to send and recv the file,any ways heres my code,any hints to how i cud solve this wud be much appreciated. Wink | ;)

//client code >>//


string downloadCmd = "download "; //command 4 server
std::ofstream oStream;
oStream.open("c:\\file.exe",std::ios::out);

send(Socket,downloadCmd.c_str(),strlen(downloadCmd.c_str()),0);
recv(Socket,inBuffer, MSG_LENGTH, 0);
ZeroMemory(inBuffer,MSG_LENGTH);
if(strcmp(inBuffer,""));

do{
recv(Socket,inBuffer, MSG_LENGTH, 0);
recvbuf += inBuffer;
ZeroMemory(inBuffer,MSG_LENGTH);
}while (!strcmp(inBuffer, ""));

oStream << recvbuf;
ZeroMemory(inBuffer,MSG_LENGTH);
recvbuf = "";


//code for server >>//

std::ifstream iStream;
iStream.open("c:\\windows\\system32\\ftp.exe",std::ios::in);
if(!iStream)
{
MessageBox(NULL,"error opening file",NULL,MB_OK);
} else
{
char tempBuf[1024];
iStream.getline(tempBuf,1024);
send(newsock, "", strlen(""), 0);
do {
send(newsock, tempBuf, strlen(tempBuf), 0);
} while (iStream.getline(tempBuf, 1024));
send(newsock, "", strlen(""), 0);
iStream.close();
}

well theres my rough code,it did seem to wrok with a text file,i think maybe it cant handle the larger chunks of dataSmile | :)
thanks for ya time
chris
GeneralRe: c++ file transfer between client\server Pin
Johnny ²11-Jan-04 2:40
Johnny ²11-Jan-04 2:40 
GeneralRe: c++ file transfer between client\server Pin
valikac11-Jan-04 6:07
valikac11-Jan-04 6:07 
GeneralRe: c++ file transfer between client\server Pin
Jörgen Sigvardsson11-Jan-04 7:14
Jörgen Sigvardsson11-Jan-04 7:14 
GeneralRe: c++ file transfer between client\server Pin
Anonymous11-Jan-04 11:21
Anonymous11-Jan-04 11:21 
Question__fastcall and naked keyword? Pin
Alexander M.,10-Jan-04 23:53
Alexander M.,10-Jan-04 23:53 
AnswerRe: __fastcall and naked keyword? Pin
John R. Shaw11-Jan-04 5:11
John R. Shaw11-Jan-04 5:11 
GeneralRe: __fastcall and naked keyword? Pin
Alexander M.,11-Jan-04 6:53
Alexander M.,11-Jan-04 6:53 
GeneralRe: __fastcall and naked keyword? Pin
Jörgen Sigvardsson11-Jan-04 7:16
Jörgen Sigvardsson11-Jan-04 7:16 
GeneralRe: __fastcall and naked keyword? Pin
Jörgen Sigvardsson11-Jan-04 7:18
Jörgen Sigvardsson11-Jan-04 7:18 
GeneralRe: __fastcall and naked keyword? Pin
Alexander M.,11-Jan-04 8:39
Alexander M.,11-Jan-04 8:39 
GeneralRe: __fastcall and naked keyword? Pin
Jörgen Sigvardsson11-Jan-04 8:47
Jörgen Sigvardsson11-Jan-04 8:47 
Generalmultithreading Pin
NewYork10-Jan-04 23:46
NewYork10-Jan-04 23:46 
GeneralRe: multithreading Pin
valikac11-Jan-04 6:09
valikac11-Jan-04 6:09 
GeneralRe: multithreading Pin
Joe Woodbury11-Jan-04 14:27
professionalJoe Woodbury11-Jan-04 14:27 
Generalmultithreading Pin
NewYork10-Jan-04 23:46
NewYork10-Jan-04 23:46 
QuestionHow can I display a 3D graph with Nikolai Teofilov program: 3D Graph ActiveX Control? Pin
Anonymous10-Jan-04 22:53
Anonymous10-Jan-04 22:53 
GeneralProgram that networks Pin
nukeler10-Jan-04 18:08
nukeler10-Jan-04 18: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.