Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup connection using tls.DialWithDialer() instead of tls.Dial() #6

Closed
atc0005 opened this issue Jun 7, 2020 · 1 comment · Fixed by #12
Closed

Setup connection using tls.DialWithDialer() instead of tls.Dial() #6

atc0005 opened this issue Jun 7, 2020 · 1 comment · Fixed by #12
Labels
enhancement New feature or request
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Jun 7, 2020

In short, some sort of timeout is needed as otherwise the connection could "hang" for an extended amount of time. I encountered at least one case during testing where I gave up after a long wait and hit Ctrl-C. This is "OK" for interactive testing, but would likely cause issues for proper Nagios plugin operation.

References:

@atc0005 atc0005 added the enhancement New feature or request label Jun 7, 2020
@atc0005 atc0005 added this to the Future milestone Jun 7, 2020
@atc0005
Copy link
Owner Author

atc0005 commented Jun 7, 2020

Found this example:

	dialer := &net.Dialer{

		Timeout: 10 * time.Millisecond,

	}


	var err error

	if _, err = DialWithDialer(dialer, "tcp", addr, nil); err == nil {

		t.Fatal("DialWithTimeout completed successfully")

	}

@atc0005 atc0005 pinned this issue Jun 7, 2020
@atc0005 atc0005 modified the milestones: Future, v0.1.0 Jun 7, 2020
atc0005 added a commit that referenced this issue Jun 7, 2020
- update README file to reflect new flag
- update CHANGELOG to note new feature
- use custom net.Dialer with custom timeout value,
  fallback to application default value of 10s

refs #6, #7
atc0005 added a commit that referenced this issue Jun 7, 2020
- update README file to reflect new flag
- update CHANGELOG to note new feature
- use custom net.Dialer with custom timeout value,
  fallback to application default value of 10s

refs #6, #7
@atc0005 atc0005 unpinned this issue Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant