Hello.
I want to open a TCP socket, connect it to another TCP socket, send there an initialization packet (JSON with a couple of fields), and then listen to the port, from which I have just sent a init packet.
In fact, in some way I need a duplex socket (or more like a bidirectional socket), and as far as I know, this is possible.
Do I understand correctly that I can do this:
- Initialize FSocket by attaching a specific address + port to it of my server
- Connect to the desired socket using the FSocket method::Connect(const Internetaddr &Adr) to the “SomeServer” server
- Send packets using FSocket::SendBytes
- Start listening to my socket using the FSocket::Listen method, where packets from “SomeServer” will arrive
Will FSocket normally accept that I want to connect first and then listen?
p.s. in the second step, I connect to the “SomeServer” server, after which I should not disconnect from it