I’ve been developing a plugin using the FSocket API, and I’ve come to a point where when I want my UE4 client to send the outbound data present in the socket’s output stream buffer, that I need to close the socket itself to flush/push the data. I would prefer to close the output stream independent of the input stream as the client needs to receive a response from the server.
I would like to have the FSocket in UE4 to accomplish these tasks in order
1: UE4 Client - Send Data to External Server
2: UE4 Client - Close Output Stream, pushing data to server
3: External Server - Receives data from UE4 Client
4: External Server - Send data to UE4 Client
5: UE4 Client - Receive Data from External Server
6: UE4 Client - Close Input Stream
The problem existing in that sending data in step two, I’ve found no way of closing the output stream in an FSocket independent of the input stream, and instead have only managed to send data when closing the FSocket itself. An example of my implementation working is
1: External Server - Send Data to UE4 Client
2: UE4 Client - Receives data from External Server
3: UE4 Client - Sends data to External Server
4: UE4 Client - Closes FSocket
5: External Server - Receives Data from UE4 Client
The above implementation works as intended, but I require the client to be the first to send, and last to receive the data with the server, so besides closing the FSocket I need a way of flush the output stream’s buffer.