Issue with Socket IO on Windows

Hi there,

I try to use socket IO on Windows:

require "http/web_socket"
socket ="ws://")

socket.on_binary do |msg|
  puts "on_binary"

socket.on_message do |msg|
  puts "on_message"

socket.on_close do

f1 = spawn do
  puts "on_fiber_f1"
  socket.send "Hello"

After executing, if no data is sent from the server, reading data from the socket should be blocked, and then the scheduler should resume fiber f1. It works on Linux, but not work as expected on Windows, the f1 does not execute.

Did i misunderstand something? Thanks.

Fibers are not implemented at all on Windows, so only one of the two branches in this code ever gets to run.

Fibers actually are implemented. The event loop is missing.

1 Like