[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
tcpstream class problem - please help
From: |
Pavel Tsekov |
Subject: |
tcpstream class problem - please help |
Date: |
Tue, 28 Aug 2001 09:46:02 +0200 |
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.
- tcpstream class problem - please help,
Pavel Tsekov <=