Coder Social home page Coder Social logo

Comments (6)

isaaguilar avatar isaaguilar commented on June 15, 2024 1

It doesn't handle closes automatically. The issue in versions of this package between v1.0.1 and 1.1.0 is that the WaitGroup was implemented incorrectly; the counter was never incremented to begin with.

The latest version (currently v1.1.1) does not use the sync package anymore. Instead the tunnel is kept alive using a new function that waits for new connections and Close() behaves as expected.

from sshtunnel.

eleijonmarck avatar eleijonmarck commented on June 15, 2024

@isaaguilar thank you!
I am using v1.1.0 I see now.

will get back when I have tested it with Closing the tunnel.

from sshtunnel.

eleijonmarck avatar eleijonmarck commented on June 15, 2024

Amazing now it works to close the tunnels

from sshtunnel.

eleijonmarck avatar eleijonmarck commented on June 15, 2024

@isaaguilar
Now that I have the ability to Close the tunnel. I am experiencing a bit of error logs from the tunnel implementation.

	// Start the server in the background. You will need to wait a
	// small amount of time for it to bind to the localhost port
	// before you can start sending connections.
	go tunnel.Start()
	defer func() {
		time.Sleep(5 * time.Second)
		tunnel.Close()
	}()

Even if I wait 5 seconds for the tunnel to get any io.Copys out of the way (and I am not creating anything or so) I still get an error of io.Copy

2020/09/22 16:44:33.035361 accepted connection
2020/09/22 16:44:33.035380 listening for new connections...
2020/09/22 16:44:33.076055 connected to 11.11.11.11:22 (1 of 2)
2020/09/22 16:44:33.078677 connected to 22.22.22.22:22 (2 of 2)
2020/09/22 16:44:39.385185 close signal received, closing...
2020/09/22 16:44:39.385195 closing the netConn (1 of 2)
2020/09/22 16:44:39.385304 io.Copy error: read tcp 127.0.0.1:2000->127.0.0.1:40330: use of closed network connection
2020/09/22 16:44:39.385311 closing the netConn (2 of 2)
2020/09/22 16:44:39.385416 closing the serverConn (1 of 1)
2020/09/22 16:44:39.386128 tunnel closed

from sshtunnel.

elliotchance avatar elliotchance commented on June 15, 2024

Please open a new ticket.

from sshtunnel.

eleijonmarck avatar eleijonmarck commented on June 15, 2024

will do

from sshtunnel.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.