?
Solved

c# ssh tunnel with plink

Posted on 2014-11-26
4
Medium Priority
?
452 Views
Last Modified: 2015-02-16
I have a C# web application that runs on Windows Server 2008 r2 and .NET 4. I have an SSH tunnel set up that runs via plink and stays running via AlwaysUp.

This web app was previously running on Win2k Server with .NET 1.1 and the tunnel would stay open as long as the server was running.

However, I've noticed now on the new server the web app can not maintain the connection. If I touch the web.config file the web app can use the connection and all is well. However, after about 2-3 minutes the connection is still alive on the server, but the web app won't connect until I touch the web.config again.

I'm not much of hardware person so I'm hoping maybe there is a setting on the server or within the web app that I am missing or something has changed in .NET idk I'm at a loss.
0
Comment
Question by:YPU
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 23

Expert Comment

by:David
ID: 40469933
Not my area, yet I wonder why you use plink (for batch-style commands); and at least for the other SSH connections I can set a keepalive parameter in my host's ssh_config.  HTH
0
 
LVL 30

Expert Comment

by:serialband
ID: 40474908
With Openssh, you could supply the "-o ServerAliveInterval=120" when you call the command.  Unfortunately, plink doesn't allow options to be passed through.  You'll have to set it in your config file.

Run the following to add the interval to your account's client configuration file.
echo "ServerAliveInterval 120"  >>  ~/.ssh/ssh_config
0
 

Accepted Solution

by:
YPU earned 0 total points
ID: 40603754
I solved this issue on my own. I found that I was not properly closing the connection to the mysql database and there were too many connections to the db, causing the db to disallow any new connections. I patched the code and restarted the db and all is well.
0
 

Author Closing Comment

by:YPU
ID: 40611886
Problem solved. Make sure the database you are trying to connect to has available connections.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
A publishing tool, a Version Control System, or a Collaboration Platform! These can be some of the defining words for the two very famous web-hosting Git repositories: Bitbucket and Github. Git is widely used amongst the programmers and developers f…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question