socketry / nio4r

Cross-platform asynchronous I/O primitives for scalable network clients and servers.
Other
970 stars 86 forks source link

Windows Build #281

Open cfis opened 2 years ago

cfis commented 2 years ago

Nio4r builds fine on mingw64 after removing the code to make a dummy make file at the top of extconf.rb. Is there more to it than that, or would it be worth me submitting a patch to remove the special windows handling code?

MSP-Greg commented 2 years ago

Nio4r uses libev, which isn't usable on WIndows?

tarcieri commented 2 years ago

libev works on Windows via the select backend. It can’t handle a large number of I/O objects and performs poorly as compared to e.g. IOCP, but the base functionality should still work.

See: http://cvs.schmorp.de/libev/ev_select.c?view=markup

cfis commented 2 years ago

Note that tests do pass:

Pending: (Failures listed here are expected and do not affect your suite's status)

  1) UDPSocket behaves like an NIO selectable does not select unwritable objects
     # come up with a UDPSocket that's blocked on writing
     Failure/Error: raise TypeError, "can't convert #{io.class} into IO" unless io.is_a? IO

     TypeError:
       can't convert NilClass into IO
     Shared Example Group: "an NIO selectable" called from ./spec/nio/selectables/udp_socket_spec.rb:47
     # ./lib/nio/monitor.rb:19:in `initialize'
     # ./lib/nio/selector.rb:59:in `new'
     # ./lib/nio/selector.rb:59:in `block in register'
     # ./lib/nio/selector.rb:53:in `synchronize'
     # ./lib/nio/selector.rb:53:in `register'
     # ./spec/support/selectable_examples.rb:36:in `block (2 levels) in <top (required)>'

  2) IO.pipe behaves like an NIO selectable does not select unwritable objects
     # windows - can't test due to 'select' not showing correct status
     # ./spec/support/selectable_examples.rb:35

Finished in 8.94 seconds (files took 0.86068 seconds to load)
112 examples, 0 failures, 2 pending