GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 28-Mar-2008, 05:54
naxatra naxatra is offline
New Member
 
Join Date: Mar 2008
Posts: 4
naxatra is on a distinguished road

Connecting to a server through Plink


Hi All,
I have a MFC app which calls needs to connect to a server and then monitor its perf.the entire process of connecting to the server and sending commands to it and retreiving the response from the server is automated in the MFC app.For this the app uses a client console app called Plink. The app starts Plink process to initiate the process of connecting to the server.For starting Plink,the app uses CreateProcess with a commandline to be sent to the server so that the server prompts with the username with which to login.Once the server sends the username prompt,the application has to write the username string to the console tht opens whn we call Plink.

Now the prob is whn I write the username string to the console output screen followed by a carriage return and a line feed,it doesnt prompt me for the password as the case shd be. I am using WriteConsole API to write to the Plink console window and use pass the standard console output handle to write.

Am I going wrong somewhere?
Should I write to the console input or the console output handle?

Any kind of help is welcome.
Please help.

Thanks in advance,
Jyoti
  #2  
Old 28-Mar-2008, 08:49
inevitable inevitable is offline
Junior Member
 
Join Date: Nov 2007
Posts: 53
inevitable is on a distinguished road

Re: Connecting to a server through Plink


After your above mentioned steps, What is the output shown?

If some output is shown, then password is accepted with WriteConsole in the first instance itself.
  #3  
Old 30-Mar-2008, 21:02
naxatra naxatra is offline
New Member
 
Join Date: Mar 2008
Posts: 4
naxatra is on a distinguished road

Re: Connecting to a server through Plink


In the console window I donot see any output except that the cursor moves to the leftmost position in the next line.
So I assume that carriage return is working but locally in the console window but the username string and the carriage return is not being sent to the server by Plink.

Thanks,
Jyoti Sarkar
  #4  
Old 01-Apr-2008, 07:12
inevitable inevitable is offline
Junior Member
 
Join Date: Nov 2007
Posts: 53
inevitable is on a distinguished road

Re: Connecting to a server through Plink


Hi, Sorry for the delay
Try sending user name and CRLF as two separate functions.
Even then the command is not accepted by Plink indicates that Plink is not part of the app you are writing.
__________________
Logic is Inevitable.
  #5  
Old 02-Apr-2008, 00:36
naxatra naxatra is offline
New Member
 
Join Date: Mar 2008
Posts: 4
naxatra is on a distinguished road

Re: Connecting to a server through Plink


I tried sending the username and the CRLF seperately in two consecutive calls to WriteConsole passing the handle of the standard console output but to no success.
I am using the executable of Plink and not any source code. It is a third party tool which is freely available. It is a commandline tool which needs to be started from the console. For this my app uses standard console input and standard console output handles. To retrieve the handles the app uses GetStdHandle API. My app is also an executable which creates Plink as a seperate process with a commandline "plink -<telnet/rlogin/ssh> <server IP>". This starts Plink in a console window and I am prompted for the username. I can see the login: prompt in the console window. When I write the username to the output handle of the console,it writes the username along with the CR and LF.The username string is printed on the console output and the cursor moves to the left most position in the next line.But I donot get the password prompt which in ideal condition the server should have sent once it received the username string. Server is running because I have checked it using Plink manually.
I have tried the following without any positive results:
WriteConsole with output handle
WriteConsole with input handle
WriteConsoleOutput with output handle
WriteConsoleOutput with input handle

I have no clue where I am going wrong.

Please do help.

Thank you so much for looking into the matter and replying.

Jyoti Sarkar
 
 

Recent GIDBlogInstall Adobe Flash - Without Administrator Rights by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
BarracudaDrive application server for Linksys NSLU2 BDG Computer Software Forum - Linux 0 24-Mar-2008 14:24
Named virtual host not working Johnnyrotton Apache Web Server Forum 4 04-Sep-2007 20:32
Microsoft SQL Server :: SQL Server message 241, state 1, severity 16 lyuboe MySQL / PHP Forum 0 11-May-2005 04:31
Apache2 config issues monev Apache Web Server Forum 2 28-Jun-2004 06:19
Can't view pages from another machine on the Intranet aevans Apache Web Server Forum 9 14-May-2004 02:26

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 09:00.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.