Xamarin Android WCF for after entering more than 10 times

0

I have an app in xamarin android that consumes a wcf service, when I instantiate the service more than 10 times the service drops and it needs to restart it and when it will reboot the bar needs to go through the middle to stop the service and then start loading a little more to start. I do not know what I can be doing wrong because I always have dispose () in the methods so I believe it is not this, can anyone help me please ??

public void Conectar(int chaveAdministrador, string cnpjEstabelecimento, string IP, string NomeBanco)
{
    sPropriedades ws = new sPropriedades();
    ws.Url = "http//"+IP+":2704/Fontes/"
    ws.CarregarBase(chaveAdministrador, cnpjEstabelecimento, IP, NomeBanco);
}

When I run this function more than 10 times next time it does not respond anymore, so I have to reboot the service on the PC

This is class sProperty in service

ServiceContract(SessionMode = SessionMode.Allowed)]
    public interface IsPropriedades
    {
        [OperationContract]
        void CarregarBase(int chaveAdministrador, string cnpjEstabelecimento, string IP, string NomeBanco);
}

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
    public class sPropriedades : IsPropriedades
    {
        public void CarregarBase(int chaveAdministrador, string cnpjEstabelecimento, string IP, string NomeBanco)
        {
            c_Propriedades.IP = IP;
            c_Propriedades.NomeBanco = NomeBanco;
            c_Propriedades.ChaveAdmin = chaveAdministrador;
            c_Propriedades.ChaveEmpresa = chaveAdministrador + "|1|" + cnpjEstabelecimento;
            c_Propriedades.ChaveCaixaDoTurno = c_Caixa_DB.BuscarChaveCaixaTurno();
            c_Propriedades.TurnoAberto = c_Caixa_DB.BuscarSituacaoTurno();
            c_Propriedades.Parametros = c_Parametros_DB.BuscarParametroFood();
        }
}
    
asked by anonymous 16.03.2018 / 12:46

1 answer

0

Problem solved! in fact the problem was on the side of the service that is accumulating enough database connections and was not closing properly. I packed it up and it worked!

    
17.03.2018 / 01:22