コード例 #1
0
ファイル: Form1.cs プロジェクト: ousttrue/unity-socket.io
        public Form1()
        {
            InitializeComponent();

            m_socket = new SocketIOSocket();
            m_socket.Debug = Console.WriteLine;
            m_socket.Info = Console.WriteLine;
            m_socket.Warning = Console.WriteLine;
            m_socket.Error = Console.WriteLine;

            m_socket.On("open", Console.WriteLine);
            m_socket.On("message", Console.WriteLine);
            m_socket.On("close", Console.WriteLine);
            m_socket.On("error", Console.WriteLine);

            m_socket.Start();

            m_ping = new PingPong(m_socket);

            m_timer = new Timer();
            m_timer.Interval = 33;
            m_timer.Tick += (o, e) =>
              {
                  m_socket.Update();
              };
            m_timer.Start();
        }