GogduNet is a communication library for TCP, UDP and P2P. It uses sockets and connects directly with all peers, allowing applications to exchange several data types, such as strings, integers, unsigned integers, booleans and JSON objects.
The library also provides a binary communication channel, which is useful to implement size sensitive protocols. Some features will work on Flash Player and AIR, while others will work on AIR only (such as UDP).
Sample
package { /** * @author : Siyania (siyania@naver.com) * @create : Jun 6, 2013 */ import flash.display.Sprite; import flash.events.Event; import gogduNet.events.GogduNetDataEvent; import gogduNet.sockets.GogduNetClient; import gogduNet.sockets.GogduNetServer; public class TCPDemo extends Sprite { public function TCPDemo() { var server:GogduNetServer = new GogduNetServer("127.0.0.1", 3333); //ë°ì´í„°ë¥¼ ìˆ˜ì‹ í–ˆì„ ë•Œ 실행ë˜ëŠ” ì´ë²¤íЏ 추가 server.addEventListener(GogduNetDataEvent.RECEIVE_DATA, serverGetData); var client:GogduNetClient = new GogduNetClient("127.0.0.1", 3333); //ì„œë²„ì— ì„±ê³µì 으로 ì—°ê²°ë˜ì—ˆì„ 때 ë°œìƒí•˜ëŠ” ì´ë²¤íЏ 추가 client.addEventListener(Event.CONNECT, onConnect); //ë°ì´í„°ë¥¼ ìˆ˜ì‹ í–ˆì„ ë•Œ 실행ë˜ëŠ” ì´ë²¤íЏ 추가 client.addEventListener(GogduNetDataEvent.RECEIVE_DATA, clientGetData); //서버 시작 server.run(); //í´ë¼ì´ì–¸íŠ¸ë¥¼ ì§€ì •ëœ ì„œë²„ì— ì—°ê²° ì‹œë„ client.connect(); function onConnect(e:Event):void { client.sendString("GogduNet.Message", "I Love Miku!!"); } function serverGetData(e:GogduNetDataEvent):void { trace("server <-", e.dataType, e.dataDefinition, e.data); server.sendString(e.socket, "GogduNet.Message", "ã¯ã€ã¯ã„ï¼"); } function clientGetData(e:GogduNetDataEvent):void { trace("client <-", e.dataType, e.dataDefinition, e.data); } } } }
RT @as3gamegears: New: GogduNet (communication lib for TCP, UDP and P2P) http://t.co/ub0HWJtouR #as3 #flash #gamedev
Now provides binary communication.^^ (GogduNetBinaryServer, GogduNetBinaryClient)
That’s awesome!
I’ve updated the description to reflect that. Thank you for that implementation and for the heads up!
Usable for on iOS and/or Android too? (like the ServerSocket Class in AIR 3.8) Or only for Desktop?
I believe it can be used on Android and iOS, as long as AIR supports the connection type you are using. You can confirm that with the author.
Is there a live example anywhere?
I couldn’t find any live example, perhaps Siyania (the author) has one.
Congratulations, any live example with comments in english? Thank you for this fantastic library.
Unfortunately I believe there is no English documentation up to the present moment. Maybe Siyania will release something in the future.
There is English documents in gitHub, but it is incomplete.
I am continuing its work.
However, do not expect because I’ve been working with Google Translator…
(and, Because there was change in the library, code of this sample does not work any more.)
Thanks for the update, Siyania! When you have a new code sample/demo, please let me know so I can update the lib description here.
About the code license, have you chose one?
does it work with mobiles / ios, android / ??
I had no chance to test it on mobile, but I believe it can be used as long as AIR supports the connection type you are using. You can confirm that with the author.