TCP and ASP and Connections
-
Hello all, I was not sure if I should throw this into C# or Asp.net forum, please move if you feel appropriate. Situation: Programming an ASP website that will allow scheduling and connecting to a remote Cisco router to help students learn to configure Cisco routers during their Cisco classes. If you did not know, Vista no longer has Hyperterminal as XP did, and Hyperterminal is no longer free. Aside from the fact that there are some open source/free TCP/IP clients out there, the need arises to make it as simple for the student as possible. My solution was/is to provide the solution via a webpage. Problem: I am quite new to ASP in general, though not C#. I wrote my own "Telnet" client that connects to the router and so far as I can tell works quite well. I am now trying to translate this Winforms application over to a ASP page that can be deployed onto the schools' server. I used a TCPClient and Stream in the Winforms application to work out the telnet client part. In trying to translate this over to an ASP page, I am unclear exactly where I need to put the connection info (ie Page_Load). I need to keep the connection open to the router at all times. Currently in my Page_Load, I establish the connection and stream, however stream.DataAvailable does not seem to work (I was using it in a loop to get the greeting and passphrase prompt). However, if I just read the stream, in a combination of 2 separate Do..While loops, I get the initial greeting/passphrase prompt. Aside from that issue, the stream is disconnected after the initial Page_Load. I need to be able to keep the connection alive for the duration that the user is logged into/viewing the webpage, and also process (via a textbox entry line on the same webpage) any commands sent by the person connected. Can anyone provide some suggestions on how to accomplish this? Is anyone available via some form of Instant Messenger that can maybe help me out (I would not normally ask this, but, I do not know any other programmers in my area)? Any help would be appreciated! Thanks!
-
Hello all, I was not sure if I should throw this into C# or Asp.net forum, please move if you feel appropriate. Situation: Programming an ASP website that will allow scheduling and connecting to a remote Cisco router to help students learn to configure Cisco routers during their Cisco classes. If you did not know, Vista no longer has Hyperterminal as XP did, and Hyperterminal is no longer free. Aside from the fact that there are some open source/free TCP/IP clients out there, the need arises to make it as simple for the student as possible. My solution was/is to provide the solution via a webpage. Problem: I am quite new to ASP in general, though not C#. I wrote my own "Telnet" client that connects to the router and so far as I can tell works quite well. I am now trying to translate this Winforms application over to a ASP page that can be deployed onto the schools' server. I used a TCPClient and Stream in the Winforms application to work out the telnet client part. In trying to translate this over to an ASP page, I am unclear exactly where I need to put the connection info (ie Page_Load). I need to keep the connection open to the router at all times. Currently in my Page_Load, I establish the connection and stream, however stream.DataAvailable does not seem to work (I was using it in a loop to get the greeting and passphrase prompt). However, if I just read the stream, in a combination of 2 separate Do..While loops, I get the initial greeting/passphrase prompt. Aside from that issue, the stream is disconnected after the initial Page_Load. I need to be able to keep the connection alive for the duration that the user is logged into/viewing the webpage, and also process (via a textbox entry line on the same webpage) any commands sent by the person connected. Can anyone provide some suggestions on how to accomplish this? Is anyone available via some form of Instant Messenger that can maybe help me out (I would not normally ask this, but, I do not know any other programmers in my area)? Any help would be appreciated! Thanks!
I know it doesn't really answer your question, but Vista does actually include a TelNet client. If you go into 'Programs and Features', then 'Turn Windows features on or off' and TelNet client is visible about six entries from the bottom (this is on Vista Home Premium). You can then run it from the Command Prompt as 'telnet', with 'telnet /?' explaining the command line arguments. Modified: Corrected spellings.
My Blog: This Blog
-
I know it doesn't really answer your question, but Vista does actually include a TelNet client. If you go into 'Programs and Features', then 'Turn Windows features on or off' and TelNet client is visible about six entries from the bottom (this is on Vista Home Premium). You can then run it from the Command Prompt as 'telnet', with 'telnet /?' explaining the command line arguments. Modified: Corrected spellings.
My Blog: This Blog
Yes, true, telnet is available in that way. I did know about that, but thanks for the reply. Trying to tie together the two OS's though is really the issue. I guess I may be over complicating it a bit, we could just supply two different instruction sets. I figured the easy solution was a web page that does not depend upon the OS, if you get my drift. You are correct in that respect though.