} // Init private void ReceiverBos(LBMMessage msg) { _timeOfDay.NewTimeStamp(); _reportBuffer.Clear(); _reportBuffer.Append('B'); _reportBuffer.Append(','); _reportBuffer.Append(_parentTmonContext.GetMessageHeader()); _reportBuffer.Append(','); _reportBuffer.Append(_timeOfDay.GetSec()); _reportBuffer.Append(','); _reportBuffer.Append(_timeOfDay.GetUsec()); _reportBuffer.Append(','); _reportBuffer.Append(_objectId); _reportBuffer.Append(','); _reportBuffer.Append(msg.topicName().Replace("\\", "\\1").Replace(",", "\\2")); _tmonUmSource.send(Encoding.ASCII.GetBytes(_reportBuffer.ToString()), _reportBuffer.Length, 0); } // ReceiverBos
} // TmonReceiver public void Init() { _tmonUmSource = _parentTmonContext.GetTmonUmSource(); _timeOfDay = new TmonGetTimeOfDay(); _messageBuffer.Clear(); if (_rcvType == ReceiverType.Regular) { _messageBuffer.Append('R'); } else if (_rcvType == ReceiverType.Wildcard) { _messageBuffer.Append('W'); } else { throw new TmonException("invalid rcvType " + (int)_rcvType); } _messageBuffer.Append(','); _messageBuffer.Append(_parentTmonContext.GetMessageHeader()); _messageBuffer.Append(','); _messageBuffer.Append(_timeOfDay.GetSec()); _messageBuffer.Append(','); _messageBuffer.Append(_timeOfDay.GetUsec()); _messageBuffer.Append(','); _messageBuffer.Append(_objectId); _messageBuffer.Append(','); _messageBuffer.Append(_topicName); _tmonUmSource.send(Encoding.ASCII.GetBytes(_messageBuffer.ToString()), _messageBuffer.Length, 0); } // Init
} // Init public void Close() { _timeOfDay.NewTimeStamp(); _messageBuffer.Clear(); _messageBuffer.Append('s'); _messageBuffer.Append(','); _messageBuffer.Append(_parentTmonContext.GetMessageHeader()); _messageBuffer.Append(','); _messageBuffer.Append(_timeOfDay.GetSec()); _messageBuffer.Append(','); _messageBuffer.Append(_timeOfDay.GetUsec()); _messageBuffer.Append(','); _messageBuffer.Append(_objectId); _tmonUmSource.send(Encoding.ASCII.GetBytes(_messageBuffer.ToString()), _messageBuffer.Length, 0); } // Close
} // TmonContext public void Close() { _timeOfDay.NewTimeStamp(); _messageBuffer.Clear(); _messageBuffer.Append('t'); _messageBuffer.Append(','); _messageBuffer.Append(GetMessageHeader()); _messageBuffer.Append(','); _messageBuffer.Append(_timeOfDay.GetSec()); _messageBuffer.Append(','); _messageBuffer.Append(_timeOfDay.GetUsec()); _tmonUmSource.send(Encoding.ASCII.GetBytes(_messageBuffer.ToString()), _messageBuffer.Length, 0); Dispose(); } // close
} // TmonSource public void Init() { _tmonUmSource = _parentTmonContext.GetTmonUmSource(); _timeOfDay = new TmonGetTimeOfDay(); _messageBuffer.Clear(); _messageBuffer.Append('S'); _messageBuffer.Append(','); _messageBuffer.Append(_parentTmonContext.GetMessageHeader()); _messageBuffer.Append(','); _messageBuffer.Append(_timeOfDay.GetSec()); _messageBuffer.Append(','); _messageBuffer.Append(_timeOfDay.GetUsec()); _messageBuffer.Append(','); _messageBuffer.Append(_objectId); _messageBuffer.Append(','); _messageBuffer.Append(_topicName); _tmonUmSource.send(Encoding.ASCII.GetBytes(_messageBuffer.ToString()), _messageBuffer.Length, 0); } // Init
} // close public void InitSender() { // Encode app ID. _appId = _appUmContext.getAttributeValue("monitor_appid") .Replace("\\", "\\1") .Replace(",", "\\2"); _transportOptsStr = _appUmContext.getAttributeValue("monitor_transport_opts"); _transportOpts = _transportOptsStr.Split(';'); // Encode context name. _appContextName = _appUmContext.getAttributeValue("context_name") .Replace("\\", "\\1") .Replace(",", "\\2"); GetMonSettings(); // Get monitoring setting from application context. UmCtxCreate(); UmSrcCreate(); Thread.Sleep(200); // Allow TR to work. _messageHeader = _appId + "," + ThisHostIpAddress() + "," + Process.GetCurrentProcess().Id + "," + _objectId; _timeOfDay = new TmonGetTimeOfDay(); // Send monitoring message that context is created. _messageBuffer.Clear(); _messageBuffer.Append('T'); _messageBuffer.Append(','); _messageBuffer.Append(GetMessageHeader()); _messageBuffer.Append(','); _messageBuffer.Append(_timeOfDay.GetSec()); _messageBuffer.Append(','); _messageBuffer.Append(_timeOfDay.GetUsec()); _messageBuffer.Append(','); _messageBuffer.Append(_appContextName); _tmonUmSource.send(Encoding.ASCII.GetBytes(_messageBuffer.ToString()), _messageBuffer.Length, 0); } // InitSender