private void Start()
    {
        socket       = new SocketLib();
        messageQueue = new MessageQueue();

        socket.AddMessageRecieve(msg =>
        {
            messageQueue.Push(msg);
        });
    }
Esempio n. 2
0
    private Postbox postbox;    //메세지 큐를 관리하는 우편함

    void Awake()
    {
        socket  = new SocketLib();
        postbox = Postbox.GetInstance;

        //큐 탐색 시작
        StartCoroutine(CheckQueue());
        //데이타 요청 시작
        RequestData();
    }
Esempio n. 3
0
    private void SocketStart()
    {
        socket  = new SocketLib();
        postbox = Postbox.GetInstance;
        //큐 탐색 시작
        Debug.Log("큐 탐색 시작");
        StartCoroutine(CheckQueue());

        //데이타 요청 시작
        Debug.Log("요청 시작");
        RequestData();
    }
        /// <summary>
        /// 在服务器进行连接.
        /// </summary>
        public void MainStart()
        {
            dll_MainLib = new SocketLib();
            dll_MainLib._GCSysMessage      += A_ShowMessage;
            dll_MainLib._GCSocketClosed    += A_GCSocketClosed;
            dll_MainLib._GCSocketConnected += A_GCSocketConnected;
            dll_MainLib._GCSocketError     += A_GCSocketError;
            dll_MainLib._GCSocketReceived  += A_GCSocketReceived;
            //纷腾服务器IP.
            string ftServerIp = "123.59.41.81";
            //纷腾服务器端口.
            int port = 10011;

            dll_MainLib.GC_StartUp(ftServerIp, port);
            //_MsgBox += ShowText;
        }