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


     * @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("", 3333);
            //데이터를 수신했을 때 실행되는 이벤트 추가
            server.addEventListener(GogduNetDataEvent.RECEIVE_DATA, serverGetData);

            var client:GogduNetClient = new GogduNetClient("", 3333);
            //서버에 성공적으로 연결되었을 때 발생하는 이벤트 추가
            client.addEventListener(Event.CONNECT, onConnect);
            //데이터를 수신했을 때 실행되는 이벤트 추가
            client.addEventListener(GogduNetDataEvent.RECEIVE_DATA, clientGetData);

            //서버 시작
            //클라이언트를 지정된 서버에 연결 시도

            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);
Multiplayer. URL.