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

Update copas.settimeout #166

Closed
wants to merge 1 commit into from
Closed

Conversation

AMD-NICK
Copy link

@AMD-NICK AMD-NICK commented Nov 22, 2023

I used copas.settimeout after copas.wrap, but the socket was still being read endlessly until I printed the timeout table while copas is running and noticed that there were unwrapped sockets in the table

screenshot_2023-11-22_10 17 55@2x

screenshot_2023-11-22_10 18 41@2x

fix settimeout behavior
@Tieske
Copy link
Member

Tieske commented Nov 22, 2023

Not sure about this. Typically the copas.xxx(skt, ...) functions must be called with a luasocket socket, not a copas one. Not just this one, but all of them.

I think, if anything, we should add assertions, and fail hard if called with the wrong socket type.

if skt is an already wrapped socket, one should call skt:settimeouts(a, b, c)

@AMD-NICK
Copy link
Author

really, it's my mistake. I looked at the documentation sock:settimeout instead of copas.settimeout, and it says to execute after copas.wrap. I only just now noticed that I was looking at the wrong thing.

So assert could be useful for cases like mine

@Tieske
Copy link
Member

Tieske commented Dec 18, 2023

closing this for now.

@Tieske Tieske closed this Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants