CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    9

    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


  2. #2
    Join Date
    May 1999
    Location
    Atlanta, GA, USA
    Posts
    443

    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
  •  





Click Here to Expand Forum to Full Width

Featured