ianharrigan / hxWebSockets

hxWebSockets - websockets for all haxe platforms
https://github.com/ianharrigan/hxWebSockets
81 stars 18 forks source link

JS Target doesn't support threads #39

Open XANOZOID opened 1 year ago

XANOZOID commented 1 year ago

WebSocketServer.hx on line 108 should have guards for this:

    #if threaded_handlers
    private function handlerThread() {
        var handler:T = sys.thread.Thread.readMessage(true);
        while (handler.state != State.Closed) {
            handler.handle();
            Sys.sleep(sleepAmount);
        }
        #if threaded_handlers
        _serverMutex.acquire();
        _handlersClosed.push(handler);
        _serverMutex.release();
        #end
    }
    #end

I can make a pull request, will just take me a bit to get to that.

ianharrigan commented 1 year ago

fair point :)