Dispose() public method

Disposes of this connection, releasing channel buffers that it holds.

public Dispose ( ) : void
return void
コード例 #1
0
 public virtual void Disconnect()
 {
     m_AsyncConnect = ConnectState.Disconnected;
     ClientScene.HandleClientDisconnect(m_Connection);
     if (m_Connection != null)
     {
         m_Connection.Disconnect();
         m_Connection.Dispose();
         m_Connection = null;
         NetworkTransport.RemoveHost(m_ClientId);
     }
 }
コード例 #2
0
 public void DisconnectAllConnections()
 {
     for (int i = 0; i < m_Connections.Count; i++)
     {
         NetworkConnection conn = m_Connections[i];
         if (conn != null)
         {
             conn.Disconnect();
             conn.Dispose();
         }
     }
 }
コード例 #3
0
 /// <summary>
 ///   <para>This disconnects all of the active connections.</para>
 /// </summary>
 public void DisconnectAllConnections()
 {
     for (int index = 0; index < this.m_Connections.Count; ++index)
     {
         NetworkConnection connection = this.m_Connections[index];
         if (connection != null)
         {
             connection.Disconnect();
             connection.Dispose();
         }
     }
 }
コード例 #4
0
 public void DisconnectAllConnections()
 {
     for (int i = 0; i < this.m_Connections.Count; i++)
     {
         NetworkConnection networkConnection = this.m_Connections[i];
         if (networkConnection != null)
         {
             networkConnection.Disconnect();
             networkConnection.Dispose();
         }
     }
 }
コード例 #5
0
 private void OnDisconnected(NetworkConnection conn)
 {
     conn.InvokeHandlerNoData(0x21);
     for (int i = 0; i < conn.playerControllers.Count; i++)
     {
         if ((conn.playerControllers[i].gameObject != null) && LogFilter.logWarn)
         {
             Debug.LogWarning("Player not destroyed when connection disconnected.");
         }
     }
     if (LogFilter.logDebug)
     {
         Debug.Log("Server lost client:" + conn.connectionId);
     }
     conn.RemoveObservers();
     conn.Dispose();
 }