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

OnError never called #80

Open
egmkang opened this issue Jan 6, 2020 · 6 comments
Open

OnError never called #80

egmkang opened this issue Jan 6, 2020 · 6 comments

Comments

@egmkang
Copy link

egmkang commented Jan 6, 2020

run sample EchoServer, and telnet 127.0.0.1 9988, and then close telnet window

the sample will print

dbug: ScheduleHandle[0]
      UV_TCP 1859236454736 read completed.
trce: ScheduleHandle[0]
      UV_TCP 1859236454736 Read stopped

but OnError callback never be called.

@egmkang
Copy link
Author

egmkang commented Jan 6, 2020

@StormHub

if (status != (int)uv_err_code.UV_EOF) // Stream end is not an error

End of file is not an error, so OnError will not be called.....

@StormHub
Copy link
Owner

StormHub commented Jan 6, 2020

I think OnError is not supposed to be called in this case.

@egmkang
Copy link
Author

egmkang commented Jan 7, 2020

@StormHub so how can i get the event, which the socket has been closed by remote

@egmkang
Copy link
Author

egmkang commented Jan 7, 2020

@StormHub
http://think-async.com/Asio/asio-1.12.2/doc/asio/reference/async_read.html

system call read return 0 may not be an error, but application want to know this event, this is important

@StormHub
Copy link
Owner

Yep, I got the idea but now I am wondering how to expose this. For example, it could be a read complete with error or simply expose as error. Any preference from you?

@egmkang
Copy link
Author

egmkang commented Jan 20, 2020

all ways will be ok for me.
thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants