Is there any finished crossplatform implementation of NetConnection?
I’m particularly interested in NetConnection.call
I know that there are some native libs for js and curl, and that there’s half-implemented amf support in format lib which can be used to implement AMF messages, but that’s too complicated.
There’s Loader, URLLoader and Socket, NetConnection would require AMF support, right? HxScout has AMF support that might be MIT and possible to (either) extend in the format lib or something we could/should include in OpenFL
Are you trying to talk a Flash Media Server, or something else?
It’s talking to “fluorine” .net lib. The api is already used by many flash applications, so if I want to make a client app in haxe, i’ll need to support it from my side.
I know that it’s possible to implement it manually, but it requires significant effort.
- ‘format’ lib does not support externalized objects like ArrayCollection, and it’s hard to use and extend it since it uses enums too much. Actually, it can’t be extended without changing the original sources. And existing IExternalizable interface is not compatible with format lib since it requires IDataInput while format lib uses Input
- ‘format’ lib does not support references
- Http support. I don’t know if URLLoader and Socket are good enough, but haxe’s Http requires data as String, not as Bytes, and encoded AMF message definitely contains some \0 chars, so it just truncates the message. Also it’s confusing that each lib has its own implementation of http requests. Should I use haxe, lime, openfl or maybe even something else?
- keep-alive headers and authorization. I don’t know how the cookies and headers are handled by flash player, and simulating it may be hard
- AMF message format requires some meta about target methods on server, request/response index, probably some headers, and can send several requests in single message. It’s not hard to implement a simple encoder which does not care about headers or multiple requests and indices, but it’s definitely not supported by ‘format’ lib at all
- amf0 has a code which says ‘switch to amf3’, and ‘format’ lib also does not handle that
Also it’s hard to believe and understand why it was not implemented during all the years of haxe’s existance.