Skip to content

Instantly share code, notes, and snippets.

@nadako
Created November 10, 2019 09:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nadako/1f6b6eecc339a110dbfd7249db012e2f to your computer and use it in GitHub Desktop.
Save nadako/1f6b6eecc339a110dbfd7249db012e2f to your computer and use it in GitHub Desktop.

--server-connect

Haxe 4.0 introduces a new way of communicating IDE and the compiler.

Here's what an IDE needs to do:

  • start a TCP server on some port (can pass 0 to bind to any available one)
  • start haxe --server-connect <port> where <port> is replaced with the port number the started TCP server was bound to.
  • haxe will connect to that server and await requests, ensure that happens
  • send messages of the following structure:
    • 32-bit little endian signed int with length of the following message body
    • body
  • expect response messages of the same structure

(this length-prefixed message format is the same as with --wait-stdio)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment