I have tcp client socket created by
FSocket* Socket = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateSocket(NAME_Stream, ListenName, false);
Socket->Connect(*addr);
ConnectionSocket = Socket;
Inside thread which read and send data I also tried to receive error by this way:
if (ConnectionSocket->GetConnectionState() == ESocketConnectionState::SCS_ConnectionError)
{
bErrorReceived = true;
}
But this fires only if remote server is turned down. If I manually turn down the working server with connected server, this code not fires (I would like to see “Remote server forcibly closed connection”).
In socket API I found the bool SetRecvErr(bool)
, but I find no use…