-
Notifications
You must be signed in to change notification settings - Fork 66
try to improve error handling #30
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
base: master
Are you sure you want to change the base?
Conversation
|
With the changes to Accept() in the PR Old Accept() behavior: This is with allow remote enabled. I don't believe the current behavior is correct. |
|
I still need to go check if the changes agree with the API. There may be a case or two where it doesn't. There also may be instances where the socket needs to be invalidated. IMO IsValidSocket() should only be looking at the desciptor (or SOCKET) value itself and internally invalidated by CSimpleSocket when necessary, rather than mixing it up with socket error codes as it was before. Additionally. I can write some tools and tests for this. Haven't looked to see if there are any Lua tests. ASIO might be nice, but that's presumably a much bigger library, and much bigger effort. |
…h() NOOP as TCP itself doesnt support it.
|
I suppose this is good enough for review. I haven't tested yet on Windows, but seems to be good on Linux. Also the whole TCP Flush() hack is stupid and just makes wasteful system calls. If a socket needs data sent immediately that is what TCP_NODELAY is for, and has to be set before data is written. Future improvements: support ipv6. Initialize socket in the ctor instead of a separate Initialize() function. Use poll() instead of the ancient select(). |
|
Works on Windows. ipv6 support should be easy enough but this will have to be merged first. Some of the existing bugs this patch addresses breaks ipv6. |
dfhack-runuses this.I've done only basic testing.
Probably needs some more work.
Kind ofa hassle with the C-style coding and all the macros being used.