How to pass time in SystemVerilog while waiting for data on a socket in DPI

In reply to jwhatley:

Hi jwhatley,

Would you be able to provide a sample code for the obvious workaround you talk of ?(repeatedly making the imported DPI function call to query the state of the socket, then waiting for some time)

I am trying to get multiple socket clients connected to a socket server linked to the simulator and I face issues like running out of context in a thread.