Пример #1
0
        public void Start_Restart()
        {
            var server = new TCPServer();

            server.Start(6022);
            server.Close();
            server.Start(6022);
            server.Close();
        }
Пример #2
0
    private void StartGame()
    {
        panelsManager.ShowGamePanel();
        state = GameState.GAME;
        ServerStartGameMessage ssgm = new ServerStartGameMessage();

        os.Close();
        s.ServerSend(ssgm);
    }
Пример #3
0
 private void OnDisable()
 {
     server.Close();
     server.OnServerOpen  -= InvokeOnServerOpen;
     server.OnServerClose -= InvokeOnServerClose;
     server.OnOpen        -= InvokeOnOpen;
     server.OnMessage     -= InvokeOnMessage;
     server.OnClose       -= InvokeOnClose;
     server.OnError       -= InvokeOnError;
 }
Пример #4
0
 public void Close()
 {
     if (Client != null)
     {
         Client.Close();
     }
     if (Server != null)
     {
         Server.Close();
     }
 }
Пример #5
0
 /// <summary>
 /// アプリ終了時に呼び出し、Serverを止める
 /// </summary>
 public void StopTCPServer()
 {
     try
     {
         //closeしてるけど送受信がどうなってるかは謎
         tServer.Close();
     }
     catch (Exception e)
     {
         Debug.Log(e);
     }
 }
Пример #6
0
 void OnApplicationQuit()
 {
     if (m_ServerSession != null)
     {
         m_ServerSession.Close();
         m_ServerSession = null;
     }
     if (m_ClientSession != null)
     {
         m_ClientSession.Close();
         m_ClientSession = null;
     }
 }
Пример #7
0
    void OnGUI()
    {
        GUILayout.BeginArea(new Rect(10, 10, 200, 200));
        GUILayout.Label("TCP/IP SERVER: : " + server.GetClientCount());
        if (GUILayout.Button("ConnectToServer"))
        {
            server.Setup();
        }
        if (GUILayout.Button("Close"))
        {
            server.Close();
        }

        GUILayout.Space(20);
        GUILayout.Label("RECEIVE: " + receiveStr);

        sendStr = GUILayout.TextField(sendStr);
        if (GUILayout.Button("Send"))
        {
            server.Send(sendStr);
        }
        GUILayout.EndArea();
    }
Пример #8
0
 private void OnApplicationQuit()
 {
     server.Close();
 }
Пример #9
0
 public void Close()
 {
     _refereeServer.Close();
 }
Пример #10
0
 public void btnClose_Click()
 {
     server.Close();
 }