Пример #1
0
        /// <summary> Called to logoff the system </summary>
        private bool UnBind()
        {
            WriteLog("ESMEConnection : UnBind : Started : Host[{0}] Port[{1}]", Host, Port);

            bool retValue = false;

            try
            {
                UnBindSmResp ubtrp = Client.UnBind();

                switch (ubtrp.Status)
                {
                case CommandStatus.ESME_ROK:
                    WriteLog("ESMEConnection : UnBind : Info : Host[{0}] Port[{1}] Connection UnBound", Host, Port);
                    retValue = true;
                    break;

                default:
                    WriteLog("ESMEConnection : UnBind : WARNING : Host[{0}] Port[{1}] Status[{2}] Connection UnBound Failure", Host, Port, ubtrp.Status);
                    break;
                }
            }

            catch (Exception exception)
            {
                WriteLog("ESMEConnection : UnBind : ERROR : Host[{0}] Port[{1}] {2}", Host, Port, exception.Message);
            }

            WriteLog("ESMEConnection : Bind : Completed : Host[{0}] Port[{1}] RetValue[{2}]", Host, Port, retValue);

            return(retValue);
        }
Пример #2
0
        private static async Task UnbindAsync()
        {
            Console.WriteLine("Unbinding client from MiniGateway..");
            var resp = await smppClient.UnBind();

            Console.WriteLine($"--UnbindResp: {resp}");
        }
        private async Task UnBind()
        {
            _log.Info("Unbind SmppClient");
            UnBindResp resp = await _client.UnBind();

            switch (resp.Header.Status)
            {
            case CommandStatus.ESME_ROK:
                _log.Info("UnBind succeeded: Status: {0}", resp.Header.Status);
                break;

            default:
                _log.Warn("UnBind failed: Status: {0}", resp.Header.Status);
                await _client.Disconnect();

                break;
            }
        }