I have several fibers running in crystal 0.34, when I write some lines to a socket, the data is not reliable sent out, unless I send more data in a loop or put a small sleep in my send() method. Is there a better way to do this ?
Sync did not help me for the socket.
def send (object) @client << object + "\n" #send to TCP_SERVER sleep 0.000001 # this works reliable, output is flushed and sent to server, but why ? #@client.flush # does not work for me #Fiber.yield # does not work for me end