Proper way for setting up a Duplex Socket

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:

  1. Initialize FSocket by attaching a specific address + port to it of my server
  2. Connect to the desired socket using the FSocket method::Connect(const Internetaddr &Adr) to the “SomeServer” server
  3. Send packets using FSocket::SendBytes
  4. 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