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); } } } }
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.