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
Desired Implementation:
- UE4 Client - Send Data to External Server
- UE4 Client - Close Output Stream, pushing data to server
- External Server - Receives data from UE4 Client
- External Server - Send data to UE4 Client
- UE4 Client - Receive Data from External Server
- UE4 Client - Close Input Stream
The problem exists 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
Working Implementation:
- External Server - Send Data to UE4 Client
- UE4 Client - Receives data from External Server
- UE4 Client - Sends data to External Server
- UE4 Client - Closes FSocket
- 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.