/// <summary> /// Create a new acknowledgement. /// </summary> /// <param name="Result">The result of the operation.</param> /// <param name="Description">An optional description of the result code.</param> /// <param name="Warnings">Warnings or additional information.</param> /// <param name="Runtime">The runtime of the request.</param> private PushChargingStationDataResult(IId Id, IReceiveData IReceiveData, PushDataResultTypes Result, IEnumerable <PushSingleChargingStationDataResult> RejectedEVSEs = null, String Description = null, IEnumerable <Warning> Warnings = null, TimeSpan?Runtime = null) { this.Id = Id; this.IReceiveData = IReceiveData; this.Result = Result; this.RejectedEVSEs = RejectedEVSEs ?? new PushSingleChargingStationDataResult[0]; this.Description = Description.IsNotNullOrEmpty() ? Description.Trim() : null; this.Warnings = Warnings != null ? Warnings.Where(warning => warning.IsNotNullOrEmpty()) : new Warning[0]; this.Runtime = Runtime; }
public void InvokeReceive(IReceiveData rd) { ReceiveData data = (ReceiveData)rd; Channel channel = (Channel)data.Channel; channel.ReceiveDispatch.Add(data); }
public UdpConnection(int port, IReceiveData receiver = null) { connection = new UdpClient(port); this.receiver = receiver; connection.BeginReceive(OnReceive, null); }
public TcpConnection(string host, int port, IReceiveData receiver = null) { connection = new TcpClient(/* Elegir la sobrecarga correcta */); this.receiver = receiver; connection.BeginConnect(host, port, OnReceive, null); // Buscar bien que va aca }
public UdpConnection(IPAddress ip, int port, IReceiveData receiver = null) { connection = new UdpClient(); connection.Connect(ip, port); this.receiver = receiver; connection.BeginReceive(OnReceive, null); }
public void InvokeReceive(IReceiveData data) { if (ChannelReceive != null) { ReceiveData rd = (ReceiveData)data; rd.CREA.Channel = rd.Channel; ChannelReceive(Server, rd.CREA); } }
public TcpConnection(IPAddress ip, int port, IReceiveData receiver = null) { connection = new TcpClient(/* Elegir la sobrecarga correcta */); connection.Connect(ip, port); this.receiver = receiver; connection.BeginConnect(ip, port, OnReceive, null); }
NoOperation(IId AuthId, IReceiveData IReceiveData, String Description = null, IEnumerable <Warning> Warnings = null, TimeSpan?Runtime = null) => new PushChargingStationDataResult(AuthId, IReceiveData, PushDataResultTypes.NoOperation, new PushSingleChargingStationDataResult[0], Description, Warnings, Runtime);
Success(IId AuthId, IReceiveData IReceiveData, String Description = null, IEnumerable <Warning> Warnings = null, TimeSpan?Runtime = null) => new PushEVSEDataResult(AuthId, IReceiveData, PushDataResultTypes.Success, new EVSE[0], Description, Warnings, Runtime);
Error(IId AuthId, IReceiveData IReceiveData, IEnumerable <PushSingleChargingStationDataResult> RejectedEVSEs = null, String Description = null, IEnumerable <Warning> Warnings = null, TimeSpan?Runtime = null) => new PushChargingStationDataResult(AuthId, IReceiveData, PushDataResultTypes.Error, RejectedEVSEs, Description, Warnings, Runtime);
AdminDown(IId AuthId, IReceiveData IReceiveData, IEnumerable <EVSE> RejectedEVSEs = null, String Description = null, IEnumerable <Warning> Warnings = null, TimeSpan?Runtime = null) => new PushEVSEDataResult(AuthId, IReceiveData, PushDataResultTypes.AdminDown, RejectedEVSEs, Description, Warnings, Runtime);
/// <summary> /// Create a new PushEVSEData result. /// </summary> /// <param name="AuthId">The unqiue identification of the authenticator.</param> /// <param name="IReceiveData">An object implementing IReceiveData.</param> /// <param name="Result">The result of the operation.</param> /// <param name="Description">An optional description of the result code.</param> /// <param name="RejectedEVSEs">An enumeration of rejected EVSEs.</param> /// <param name="Warnings">Warnings or additional information.</param> /// <param name="Runtime">The runtime of the request.</param> internal PushEVSEDataResult(IId AuthId, IReceiveData IReceiveData, PushDataResultTypes Result, IEnumerable <EVSE> RejectedEVSEs = null, String Description = null, IEnumerable <Warning> Warnings = null, TimeSpan?Runtime = null) : this(AuthId, Result, Description, RejectedEVSEs, Warnings, Runtime) { this.IReceiveData = IReceiveData; }
public void Push(string userid, string culltime, string kind, string value, int mode) { Utilities.GetLoger().Info("befor SubscribeList" + userid); if (SubscribeManager.SubscribeList.Contains(userid)) { var config = Utilities.GetConfiguration(); var serviceurl = config.AppSettings.Settings["PushServiceURL"].Value; try { using (ChannelFactory <IReceiveData> channelFactory = new ChannelFactory <IReceiveData>(new BasicHttpBinding(), serviceurl + "/WCF/MonitoringHub.svc")) { IReceiveData proxy = channelFactory.CreateChannel(); Utilities.GetLoger().Info("befor Receive" + userid); proxy.Receive(userid, DateTime.Parse(culltime), kind, value, mode); } } catch (Exception ex) { Utilities.GetLoger().Error(ex.Message); } } }
public ReceiveDataProvider(IReceiveData receiveData) { _receiveData = receiveData; }
public void InvokeReceive(IReceiveData rd) { mReceiveDispatch.Add((ReceiveData)rd); }