I’ve already asked on the answer hub but I’m not getting any help. I’m trying to play with FSockets so I can craft a basic login system, but I’m really struggling. I wrote the server in C# for simplicity sake, but as soon as the client in UE4 connects it disconnects immediately and I can’t communicate. Heres the client code in UE4:
FSocket* Socket = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateSocket(NAME_Stream, TEXT("Default"), false);
FString address = TEXT("192.168.0.100");
int32 port = 9505;
FIPv4Address ip;
FIPv4Address::Parse(address, ip);
TSharedRef<FInternetAddr>addr = ISocketSubsystem::Get(PLATFORM_SOCKETSUBSYSTEM)->CreateInternetAddr();
addr->SetIp(ip.GetValue());
add->SetPort(port);
bool isConnect = Socket->Connect(*addr);
It returns that it connected ok, but when I check the connection status it isn’t connected at all. The server sees the connection and accepts it, but if I check if it’s connected immediately after accepting the connection it’s not connected any more. Any idea what the hell is going on? I’m so confused. (Also if I check the last error its always no error)