Fix client disconnection logic and add IP address retrieval and#484
Fix client disconnection logic and add IP address retrieval and#484Neptnium wants to merge 1 commit into
Conversation
| boost::system::error_code ec; | ||
| auto ep = mSocket.remote_endpoint(ec); | ||
| if (!ec) { | ||
| mIP = ep.address().to_string(); | ||
| } |
There was a problem hiding this comment.
Is there a reason why the error code isn't handled here?
There was a problem hiding this comment.
'ec' beeing the error code I don't see what you're saying, could you please explain ?
There was a problem hiding this comment.
If there is an error the ip is skipped and then the client construction is finished. However if the remote_endpoint call failed I don't see why we'd need to keep the client. The error also isn't logged making things harder to debug.
There was a problem hiding this comment.
Oh, well this is something I did not think about, do you want me to change it ?
There was a problem hiding this comment.
Yes, that would be preferred.
|
I think this PR is deprecated by #489 |
Fixes #483 that was created after the merge of #478.
I also took the freedom to switch the mutex locking to a lockguard for safety reasons.
By creating this pull request, I understand that code that is AI generated or otherwise automatically generated may be rejected without further discussion.
I declare that I fully understand all code I pushed into this PR, and wrote all this code myself and own the rights to this code.