Mhh thats a general Socket thing you can find more info by simply googleing “Socket connect always success” Non blocking you say socket Connect dont wait for response (Don´t block) so it will return true. But you should be able to call GetConnectionState() to get the ESocketConnectionState → Connected, Not_Connected (Pending), Error(basicly refsed connection or something else hit the Fan)
Hope this helps you to understand whats happening.
if i make:
FTcpSocketBuilder(*YourChosenSocketName).AsBlocking();
then it seems work as expected.
But i dont understand, why NonBlocking mode connect is successful, and even firewall tells me that “connection is established”, even for IP address that doesnt exist.
It seems, i figured out how to Connect with non-blocking mode, but not sure.
Connect() returns “true”, in non-blocking mode - means “connecting” state, but Socket is still has SCS_Disconnected state internally, it is ok.
Now we wait SCS_Connected or SCS_ConnectionError states. If address is invalid or unavailable then we will get SCS_ConnectionError after some time, otherwise we will get SCS_Connected after some time.
Yes, thats what i thought. Plus, i’ve tested: if i call Socket-Close(), while “connecting” or “connected”, then i will get SCS_ConnectionError. So SCS_ConnectionError is used for any connection interruption, remote, local or by error.
Hi,can you give me a demo about FSocket? I’m really want to know how to use it.,Hi,can you give me a demo about FSocket? I’m really want to know how to use it