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

tcp remote side client can't detect closed. (50% probably happened). #411

Closed
jakitliang opened this issue Sep 29, 2023 · 3 comments
Closed

Comments

@jakitliang
Copy link

jakitliang commented Sep 29, 2023

Onece you had accept a socket:

Step1. Server side

local client = server.accpet()

Step2. Client side

client.close()

Step3. Server side

local data, err, data1 = client.receive()

if err == 'closed' then  -- 50% probably won't triggered close
  client.close()
  print('remote is closed')
end

Because the err == 'closed' is 50% to get triggered.

So not every time the remote close can let luasocket gave a check err == closed.

So Please tell me other way how to check a socket is already closed?

@jakitliang jakitliang changed the title tcp socket won't closed forever (50% probably happened). tcp remote side client can't detect closed. (50% probably happened). Sep 30, 2023
@alerque
Copy link
Member

alerque commented Oct 7, 2023

Any chance you could expand this into a full MWE so we can add it to the test suite and also aid in tracking this down?

@alerque
Copy link
Member

alerque commented Nov 10, 2023

I think it is possible #81 fixed this recently. We still need an MWE if you can contribute such a thing, but once we have a test case it will be worth checking against before and after that PR merge.

@alerque
Copy link
Member

alerque commented Nov 10, 2023

It seems to me this is either a duplicate of #225 or #410 (possibly even both if those two things turn out to be duplicate. Lets continue on those respective issues unless there is solid evidence for this being a unique issue.

@alerque alerque closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants