Real-time data transfer from CPU to GPU

I am receiving the raw socket data in CPU and want to transfer it to GPU in real-time.

Currently, I am filling the required buffer and then transfer the buffer data by cudaMemcpyAsync. Which is one shot?

Would writing and reading the file in realtime will be the optimal solution?

How shall I make it real-time? What are the algorithm or examples?