Hello,
In standard BSD sockets, if the recv() call returns 0, this indicates the connection was closed gracefully. Currently our wrapper function, FSocketBSD::Recv(), only returns a bool, and doesn’t provide this information, either directly or through GetConnectionState(). We’re now tracking a task to expose this information.
In the meantime, you can work around this in a couple ways:
- Modify the Recv() function to
return an int instead of a bool, return the result of the BSD recv() directly, and check that, or - If you know for sure your socket is an FSocketBSD, you can use GetNativeSocket(), call recv() directly, and check the return value. Note that this will not set the internal LastActivityTime used in GetConnectionState().