benmerckx / monsoon

Minimal haxe web framework and embedded webserver
52 stars 8 forks source link

On Linux, monsoon exits immediately after starting to listen #6

Open hamaluik opened 8 years ago

hamaluik commented 8 years ago

On Linux in "embedded" mode, the app exits immediately (does not sit around listening). On Windows, the same program runs as expected.

Tested the following with neko and cpp:

using Monsoon;

class Main {
  public static function main() {
    var app = new Monsoon();

    app.route('/', function (req, res)
      res.send('Hello World')
    );

    app.listen(3000);
  }
}

built thusly:

-cp test
-main Main

-D concurrent
-D embed

-lib monsoon
-lib tink_tcp
-lib tink_runloop
-lib tink_concurrent

--each

-neko bin/server.n

--next

-cpp bin/cpp

Any idea how to sort that out?

benmerckx commented 8 years ago

I have the same issue, reported it here: https://github.com/haxetink/tink_runloop/issues/4

clarkjones commented 8 years ago

FYI I was having the same problem on my mac until I installed a haxe nightly build just now

frabbit commented 8 years ago

i have the same problem on linux, got this error when running with gdb:

Thread 50 "Main" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fff1f7fe700 (LWP 1330)]
0x00000000005e61fa in make_array_result(Array<Dynamic>, fd_set*) ()
benmerckx commented 8 years ago

I've added a workaround for haxe 3.2.1: https://github.com/benmerckx/monsoon/blob/master/src/monsoon/Monsoon.hx#L124 It's released in monsoon 0.3.2.

The cpp build issues are unrelated, monsoon (or tink_http) currently won't function with the latest hxcpp, some discussion about it here: https://groups.google.com/forum/#!topic/haxelang/aP4fQWiEmD4

derRaab commented 7 years ago

Hugh solved a problem regarding cpp just now: https://groups.google.com/forum/#!topic/haxelang/301IdkBO_UI Just in case you run into this.