How to user socket like flash.net.Socket in nme?

305 views
Skip to first unread message

Changxin Dai

unread,
Mar 21, 2013, 3:08:45 AM3/21/13
to haxe...@googlegroups.com
I'm new to NME,  and I want to convert my flash game to android / ios platform. 
I saw there was a nme.net.Socket, but I have't find the listener like "complete", "ioError" as in flash. 
or there has a instead ? 

Alexander Kuzmenko

unread,
Mar 21, 2013, 3:55:40 AM3/21/13
to haxe...@googlegroups.com
You should use sys.net.Socket for cpp targets. There will be no events, but you can check for data in socket on ENTER_FRAME or set up Timer.
I have implemented abstraction layer for crossplatform client-side sockets. It's not perfect, but If you're interested, i can publish it.

четверг, 21 марта 2013 г., 11:08:45 UTC+4 пользователь Changxin Dai написал:

David Elahee

unread,
Mar 21, 2013, 4:08:58 AM3/21/13
to haxe...@googlegroups.com
You can find an example in the tora lib's Protocol.hx. 

2013/3/21 Alexander Kuzmenko <al...@stablex.ru>

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
David Elahee


Alexander Kuzmenko

unread,
Mar 21, 2013, 5:44:16 AM3/21/13
to haxe...@googlegroups.com
Ok, here is my attempt to create crossplatform socket class: https://github.com/RealyUniqueName/StablexNet


четверг, 21 марта 2013 г., 11:08:45 UTC+4 пользователь Changxin Dai написал:
I'm new to NME,  and I want to convert my flash game to android / ios platform. 

Samuel Batista

unread,
Mar 21, 2013, 3:40:26 PM3/21/13
to haxe...@googlegroups.com
This is awesome! Does it use TCP only or do we have the option to broadcast UDP messages with minimum performance overhead?

Alexander Kuzmenko

unread,
Mar 21, 2013, 4:31:34 PM3/21/13
to haxe...@googlegroups.com
There is no UDP support.
According to this thread haxe still lacks udp socket implementation.

Changxin Dai

unread,
Mar 22, 2013, 11:19:55 PM3/22/13
to haxe...@googlegroups.com
Thank you all very much.

在 2013年3月21日星期四UTC+8下午3时08分45秒,Changxin Dai写道:
Reply all
Reply to author
Forward
0 new messages