PDA

View Full Version : Need help reagding QTcpsocket (plzzz)



skumar434
25th March 2009, 15:29
Hi All,

I have a application which will take the hostname and the port ID as input and connect
to the console . I am using QtcpSocket to connect and reading data.

As per new requirment I need to connect to a sever / a unix machine (BSD ) and run a
command on it remotely and get the output and reflect it on the lineEdit.

The problem I am facing is that

I need to telnet to the machine and give the userID and Password to authenticate.

for example the BSD machine IP - 10.72.185.187 and telnet port -23

I have searched all over the qtcenter for help on how to send user name and password..
but I didnt found any posts on it.

I am able to progress untill connect to the host but not able to figure out how to send userid and password..

I have gone through different options like QtAuth.. QtProxy...etc , but thses wont help me ..I need to read data form a UNIX machine and all these things help for Http/Ftp.

Please help me in finding the solution ....any kind of help will be highly appricated ..:( i am stuck

faldzip
25th March 2009, 18:48
As QTcpSocket is a subclass of QIODevice, you can send data with QIODevice::write() and read by QIODevice::read() and some of it's modifications (readLine() and so on).
Then you have to send data that is defined by a Telnet protocol, so you have to search for some Telnet protocol tutorial (where QtCentre is rather about Qt than network protocols :])

Maybe this can help:
http://en.wikipedia.org/wiki/Telnet
http://support.microsoft.com/kb/231866