Haxe remoting haxe cs field not found

I had (human) Client, who decided to split his application (for performance, HA and parallalism reasons) into two parts over the network.

I tried to utilize remoting for that case, I followed the book professional haxe and neko, it compiled fine to csharp, however during runtime I recive a missing field error when it Tried to access the field “Gateway” from the HttpAsyncConnection, (I am still unsure how haxe remoting would work)

class GateWayProxy extends haxe.remoting.Proxy<ptl.Gateway> {
var cnx=haxe.remoting.HttpAsyncConnection.urlConnect(url);
            var gw=new GateWayProxy(untyped cnx.Gateway);

If I remove the untyped, then I am unable to compile at all.

Is remoting supported in cs target?


After changing the untyped cnx.Gateway to cnx.resolve("Gateway") I was able to get rid of the missing field error.

It still does not work, seems like a http issue, However the problem in the title is now solved

Any toughts?


Did you consider any other solutions for server/client? The Haxe remoting tools are now deprecated so building something from ground zero might be better with another library. There’s an interesting discussion over here.

I see, ouch, its hard to need to map the whole class, maybe making a macro to create the client server classes will remove the need of reflection as well as proper type handling, as well as a more standard protocol.

Can you elebrate on other existing similer libraries or solutions


For the record my experience with Haxe is heavily weighted to client-side, although I’ve recently needed to do more server-side stuff. I’ve had good results using tink_web compiled to both PHP and Node.js. The HxBit library mentioned on that forum looks interesting but I’ve not used it. It supports synchronization of strongly-typed objects over network and Remote Procedure Call, which at face value seems similar to what older remoting libraries would do.

I would guess that whatever solution you use, compiling to something other than Neko would be a good idea, since that also is deprecated.

For the record, in my case it was related to an incompability between nekotools server, and the cs implemtation of haxe.Http.

I’ve created a clone of the remoting class, but instead of hardcoding the communication methods, I left the option open for override (so we could use it cross not only neko and php, also usefull for nodejs webworker communication), both of the following worked
haxe.Http → nodejs server worked
cs.system.net.WebClient → nekotools server worked

1 Like