|
-
May 10th, 1999, 11:47 PM
#1
CSocket & CArchive
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
-
May 11th, 1999, 12:17 AM
#2
Re: CSocket & CArchive
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-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|