bool IExMonServer4CommsServer2.ProcessH2GMessage(ExComms.Contracts.DTO.Monitor.MonMsg_H2G request)
        {
            using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "ProcessG2HMessage"))
            {
                bool result = default(bool);

                try
                {
                    // unable to get the instllation no
                    if (request.InstallationNo <= 0)
                    {
                        Log.Info("Unable to get the installation no.");
                        return(false);
                    }

                    // find the host by installation no or ip address
                    string hostIpAddress = string.Empty;
                    if (_commsServersMapByInsno.ContainsKey(request.InstallationNo))
                    {
                        _commsServersMapByInsno.TryGetValue(request.InstallationNo, out hostIpAddress);
                    }
                    else if (!request.IpAddress.IsEmpty() &&
                             _commsServersMapByIp.ContainsKey(request.IpAddress))
                    {
                        _commsServersMapByIp.TryGetValue(request.IpAddress, out hostIpAddress);
                        _commsServersMapByInsno.GetOrAdd(request.InstallationNo, hostIpAddress);
                    }

                    // get the callback by host ip address
                    if (!hostIpAddress.IsEmpty() &&
                        _commsServerCallbacks.ContainsKey(hostIpAddress))
                    {
                        IExMonServer4CommsServerCallback callback = _commsServerCallbacks[hostIpAddress];
                        if (callback != null)
                        {
                            request.HostIpAddress = hostIpAddress;
                            result = callback.ProcessH2GMessage(request);
                        }
                    }
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }

                return(result);
            }
        }
Ejemplo n.º 2
0
        bool IExMonServer4MonProcessor.ProcessH2GMessage(ExComms.Contracts.DTO.Monitor.MonMsg_H2G request)
        {
            using (ILogMethod method = Log.LogMethod(this.DYN_MODULE_NAME, "ProcessG2HMessage"))
            {
                bool result = default(bool);

                try
                {
                    result = ((IExMonServer4CommsServer2)this).ProcessH2GMessage(request);
                }
                catch (Exception ex)
                {
                    method.Exception(ex);
                }

                return(result);
            }
        }
Ejemplo n.º 3
0
 protected override bool ProcessH2GMessageInternal(ExComms.Contracts.DTO.Monitor.MonMsg_H2G response)
 {
     return(false);
 }
Ejemplo n.º 4
0
 ExComms.Contracts.DTO.Monitor.MonMsg_G2H IExMonServer4MonClient.ProcessH2GMessageSync(ExComms.Contracts.DTO.Monitor.MonMsg_H2G request)
 {
     throw new NotImplementedException();
 }