Click to See Complete Forum and Search --> : CSocket & CArchive


franky
May 10th, 1999, 11:47 PM
i created CSocket CArchives and a CSocketFile then connected to ftp site.

these variables are pointers

if(!(sock=new CSocket)) return FALSE;
if(!(sock->Create())) return FALSE;


//connect to server
if(!(sock->Connect(serverhost,serverport)))
{
err = sock->GetLastError();
strErr.Format("%d", err);
return FALSE;
}

if(!(sockfile=new CSocketFile(sock))) return FALSE;
if(!(arRead=new CArchive(sockfile, CArchive::load))) return FALSE;
if(!(arSend=new CArchive(sockfile, CArchive::store))) return FALSE;



I received the connected signal from microsoft ftp site, the responses was from their server.
after i sent "USER anonymous" command, i tried to use arRead->ReadString(m_data) to read the response from the server, it just freezes on that line of code. can anyone help me with this?

thanks

Masaaki
May 11th, 1999, 12:17 AM
Hi.

Generally speaking, when we create CSocket, CArchive and COject derived class at the client and server program, we must put the same CArchive and CObject class at the server program.

In this case, we can't deal with ftp server program, you must change
your approach and use CFtpConnection class.
However, if you write both program like ftp client and server,
you may write the code with CSocket, CArchive and COjbect(?).
But I don't know it partly because we just write the ftp client program.

HTH.
-Masaaki Onishi-