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

Timeout issue #58

Closed
da-tai opened this issue Oct 17, 2021 · 4 comments
Closed

Timeout issue #58

da-tai opened this issue Oct 17, 2021 · 4 comments
Labels
duplicate This issue or pull request already exists TODO

Comments

@da-tai
Copy link

da-tai commented Oct 17, 2021

I am trying the below code but when testing with telnet connection, the connection stays online forever even if no data is sent to the server via telnet

var opts = []netpoll.Option{ netpoll.WithReadTimeout(10 * time.Second), netpoll.WithIdleTimeout(2 * time.Minute), netpoll.WithOnPrepare(onPrepare), }

@joway
Copy link
Member

joway commented Oct 18, 2021

@da-tai did you use conn.Next() ? it will wait for reading incoming packets and timeout if no data sent

@Hchenn
Copy link
Contributor

Hchenn commented Oct 18, 2021

Your question may be the same as #61 .
As true, there is no implement for actively close the connection after timeout.
You may need to actively close.

@Hchenn Hchenn added TODO duplicate This issue or pull request already exists labels Oct 18, 2021
@da-tai
Copy link
Author

da-tai commented Oct 19, 2021

@joway I haven't tried next

@da-tai
Copy link
Author

da-tai commented Oct 19, 2021

@Hchenn my apologies. Didn't think to Google translate the text before posting. Closing

@da-tai da-tai closed this as completed Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists TODO
Development

No branches or pull requests

3 participants