public void DisconnectServer(string clientKey) { NetClient client = NetClientManager.GetNetClient(clientKey); lock (mBroadcastRemoting) { if (mBroadcastRemoting.ContainsKey(clientKey)) { mBroadcastRemoting[clientKey].Release(); mBroadcastRemoting.Remove(clientKey); } } lock (mDataTableRemoting) { if (mDataTableRemoting.ContainsKey(clientKey)) { try { mDataTableRemoting[clientKey].Release(); } catch (Exception ex) { throw ex; } finally { mDataTableRemoting.Remove(clientKey); } } } lock (mMonitorRemoting) { if (mMonitorRemoting.ContainsKey(clientKey)) { mMonitorRemoting.Remove(clientKey); } } if (client == null) { return; } string hostname = client.HostName; LogHelper help = TableHelper.GetLogHelper(clientKey); help.LogMessage(clientKey, "Disconnect " + client.Database, LogType.NetWork); NetClientManager.DeleteClient(clientKey); }
public DataTableRemoting(string clientKey) { mLogHelper = TableHelper.GetLogHelper(clientKey); string message = "get new loghelper success."; mLogHelper.LogMessage(clientKey, message, LogType.Program); mClientKey = clientKey; NetClient netclient = NetClientManager.GetNetClient(clientKey); mHostName = netclient.HostName; mDBName = netclient.Database; message = "get net client success."; mLogHelper.LogMessage(clientKey, message, LogType.Program); mTableUnitManager = TableHelper.GetTableUnitManager(clientKey); message = "get table unit manager success."; mLogHelper.LogMessage(clientKey, message, LogType.Program); message = "get new DataTableRemoting."; mLogHelper.LogMessage(mClientKey, message, LogType.Program); }
public NetClient GetNetClient(string clientkey) { NetClient client = NetClientManager.GetNetClient(clientkey); return(client); }