Emscripten network socket

About Monkey 2 Forums Monkey 2 Programming Help Emscripten network socket

This topic contains 5 replies, has 3 voices, and was last updated by  Voidwalker 1 year, 6 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #10605

    Hezkore
    Participant

    I’ve been trying to get the ‘echoserver.monkey2’ client part to work in Emscripten but I’m only getting weird errors.
    I know Fibers aren’t support in Emscripten (right?) but I’m not sure if things like ‘Socket.Connect( HOST,PORT )’ is.

    Can I make a client for an online game in Emscripten right now using the built-in network sockets?

    #10966

    Voidwalker
    Participant

    Have you had success already?

    #10969

    Mark Sibly
    Keymaster

    It look like emscripten emulates sockets with websockets, so yes/no. You’ll need a server that can handle websockets and I have no idea how you’d go about setting that up or how to interface with it. Also, the native socket code would need to be extensively rewritten – this thread is enough to scare me off for now:

    https://github.com/kripken/emscripten/issues/3611

    Its the kind of thing I think we’d need some real expert help with.

    If yer bored, give the new desktop sockets in develop branch a try. I came up with quite a few tweaks and fixes today and I think it’s mostly working now.

    #10996

    Voidwalker
    Participant

    I think that could be helpful maybe?

    https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers

    So basically when I write a server application (no matter which language) which handles websockets it _should_ work with an monkey-emscripten client?

    #11010

    Hezkore
    Participant

    Well I really don’t care about making a server using Websockets, but connecting as a client via websockets (or something similar?) would be great 🙂

    I managed to get websockets (client) working in BlitzMax back in 2016: https://bitbucket.org/Hezkore/blitzmax-websocket

    #11023

    Voidwalker
    Participant

    As far as I understood this should already work as emscripten “wraps” the sockets stuff coming from monkey into websockets?

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.