Solved

c# ssh tunnel with plink

Posted on 2014-11-26
4
410 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 29

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
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…
This video teaches users how to migrate an existing Wordpress website to a new domain.

740 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