Comments (20)
I want to know the problem is Cool.io or libev.
Could you try following code with libev 4.15?
http://codefundas.blogspot.jp/2010/09/create-tcp-echo-server-using-libev.html
from cool.io.
And it happens only on Widows Server 2012?
What about other Windows versions?
from cool.io.
What about other Windows versions?
CPU Usage value is different, but think it is the same problem. I will check more.
from cool.io.
I want to know the problem is Cool.io or libev.
Could you try following code with libev 4.15?http://codefundas.blogspot.jp/2010/09/create-tcp-echo-server-using-libev.html
Anybody has a help to use libev on Windows ?
from cool.io.
Building libev with make
failed?
from cool.io.
I've done it now, forget it, thank you.
but process will terminate in ev_io_start().
http://codefundas.blogspot.jp/2010/09/create-tcp-echo-server-using-libev.html
I will continue to check on ev.c.
from cool.io.
@okahashi117 It means above code doesn't work on Windows corretly with libev 4.15, right?
On my Mac, the result is below(I fixed some #include for Mac manner).
Server side:
$ gcc -L. -lev test_code.c
% ./a.out
Successfully connected with client.
1 client(s) connected.
message:hoge
message:foo
message:hoge
peer might closing: Undefined error: 0
0 client(s) connected.
Client side:
% gcc -o client test_code_client.c
% ./client
warning: this program uses gets(), which is unsafe.
hoge
message: hoge
foo
message: foo
hoge
message: hoge
from cool.io.
Hi,
It means above code doesn't work on Windows corretly with libev 4.15, right?
I'm not sure because I might me making a mistaken. I'm not familiar with gcc so much, you know, and some changes to were required to build the sample code you suggeseted, especially to use WinSock.
I want to check a little more.
from cool.io.
Ah?
I'm using mingw to compile on Windows. Is it correct? Should use cygwin ?
from cool.io.
some changes to were required to build the sample code you suggeseted, especially to use WinSock.
Ah, I see.
Should use cygwin ?
No, MinGW is correct. I also compile Cool.io with MinGW for windows binary.
from cool.io.
@repeatedly Do I need some option to compile libev correctly ?
I did just 'configure --prefix=/xxxx' and 'make'.
ev_default_loop(0) always returns Null and it makes a process crash, because ev_io_start() needs a valid loop pointer to realloc memory and shows segmentation fault.
from cool.io.
@okahashi117 Hmm... how about use ev_loop_new(0)
instead of ev_default_loop(0)
?
from cool.io.
@repeatedly
Same result I got.
I found that all backend flags were off (PORT, KQUEUE, EPOLL, POLL and SELECT) so that a loop pointer is always NULL.
I may be mistaken. Could you give me any help, please.
from cool.io.
@okahashi117 Hmm. On Windows, libev should use select
.
How about define EV_USE_SELECT
like -DEV_USE_SELECT
?
from cool.io.
OK, HAVE_SELECT and HAVE_SYS_SELECT_H has been required.
But a process still terminates. I check more.
from cool.io.
@repeatedly Hi.
I built the program and tested.
'CPU100%' does not occur (0%-15%, Win2012R2, Win8, Win7).
So it seems it is a problem of Coolio or Ruby.
from cool.io.
@okahashi117 Okay.
And could you try following combination?
- Using Cool.io 1.2.2 and set timeout to run method. 0.5 or similar timeout.
- Another Ruby version, e.g. 2.0, 2.1.
I'm not familiar with Windows debug tools.
Do you find the code block which consumes CPU 100%?
from cool.io.
Same problem occurs with Cool.io 1.2.2
from cool.io.
From @okahashi117 , select
seems to receive bad file descriptor and retry causes busy loop.
We investigate the problem deeply.
from cool.io.
My investigation is here:
The problem is fd
to handle
conversion (Use _get_osfhandle
).
For example, if fd
is 3
, then handle
is 352
or similar value.
In this result, FD_SET and FD_ISSET are broken.
Set handle
using FD_SET(handle, vec_ri)
but FD_ISSET(handle, vec_ri)
failed.
I am not familiar with Windows these utilities implementation (Increase FD_SETSIZE doesn't help).
Second, I tried to use fd
instead of handle
directly.
It works on first access but select
returns an error on next access.
I'm not sure why first select
call succeeded.
TCPSocket
creates fd
using socket
function in Ruby. Using this fd
for select
is invalid?
Other status.
Disabling EV_SELECT_USE_FD_SET
doesn't help.
ev related values are same on between Windows and Mac, e.g. vec_ri, fd_count and etc.
There are several approaches to resolve this issue:
- Research windows deeply for resolving first and second case. Maybe, need Windows expert.
- Use Ruby's
select
for Windows. I'm not sure how effect other stat and timer watchers. - Implement JRuby extension
from cool.io.
Related Issues (20)
- JRuby support HOT 7
- Easier HTTP client for cool.io? HOT 4
- Fiber-aware deferred operation HOT 4
- windows ruby1.8.7 support HOT 1
- More fine GVL release span HOT 2
- Question HOT 1
- JRuby support again HOT 5
- Remove Cool.io::HttpClient HOT 1
- Remove cool.io/eventmachine.rb HOT 1
- Thread#join using coolio makes a process down on Windows. HOT 3
- Example Program in README.md not worked. HOT 5
- Investigate "expected loop to be an instance of Coolio::Loop" error HOT 2
- Change FT_SETSIZE on Windows HOT 1
- Cool.io::TCPServer continues to receive data even if its close method is called HOT 3
- Could not install when using Ruby 2.5 (x64-mingw32) HOT 2
- Use github.io instead of github.com on description HOT 1
- Two test failures with IPv6? HOT 1
- cool.io v1.7.1 fat gem doesn't include Ruby 3.0 binaries HOT 1
- cool.io is no longer buildable on Ruby 3.3.0-dev
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cool.io.