bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tcpstream class problem - please help


From: Vaclav Haisman
Subject: Re: tcpstream class problem - please help
Date: Tue, 28 Aug 2001 19:12:50 +0200 (CEST)

I don't know the FTP protocol by heart but I remember that FTP uses two
ports. One port, 21, is for data and the other, 20, is for commands. I
think you should first read RFC of FTP protocol.

Vaclav Haisman




On Tue, 28 Aug 2001, Pavel Tsekov wrote:

> Hi, there! ;)
> 
> I've downloaded the 1.5.1 version of the CommonC++ library - I inted to
> use it to communicate with remote server using sockets. Now I compiled
> the library and tried to make a simple program which writes and reads
> from socket using the tcpstream class. The program connects to the ftp
> command port(21) and send the USER command the waits using is
> isPending(SOCKET_PENDING_INPUT) and prints what it get from the
> socket...
> 
>       tcpstream tcpio("127.0.0.1:21");
>       
>       if (!tcpio)
>               cout << "Unable to connect!" << endl;
>       
>       tcpio << "USER test" << endl;
> 
>       if (isPending(SOCKET_PENDING_INPUT))
>               cout << tcpio.rdbuf();
> 
> Now what happens is that the fpt gets my USER command but I cant get any
> output from the ftp. All i gets is  a lot of garabage printed to the
> screen and it wont end until I interreupt it using Control+C... I've
> tried to do also this "cout << tcpio" but it doesnt help and it writes
> just a different garbage to the screen. 
> 
> Please anyone help :) If there is a working example of a client which
> connects to server using tcpstream please send it to me too :)
> 
> Thanks a lot.
> 
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]