public WebSocketServerBootstrap( IOptions <WebSocketOptions> webSocketOptions, IHostEnvironment hostEnvironment, ILogger <WebSocketServerBootstrap> logger) { _hostEnvironment = hostEnvironment; _logger = logger; _webSocketOptions = webSocketOptions.Value; wsAddressModel = NetUtil.GetAddressModel(_webSocketOptions.WsPort, ServiceProtocol.Ws); if (_webSocketOptions.IsSsl) { _socketServer = new WebSocketServer(IPAddress.Parse(wsAddressModel.Address), wsAddressModel.Port, true); _socketServer.SslConfiguration.ServerCertificate = new X509Certificate2( Path.Combine(_hostEnvironment.ContentRootPath, _webSocketOptions.SslCertificateName), _webSocketOptions.SslCertificatePassword); } else { _socketServer = new WebSocketServer(IPAddress.Parse(wsAddressModel.Address), wsAddressModel.Port); } _socketServer.KeepClean = _webSocketOptions.KeepClean; _socketServer.WaitTime = TimeSpan.FromSeconds(_webSocketOptions.WaitTime); //_socketServer.AllowForwardedRequest = true; }
public ActionResult GetByAddressID(int AddressID, string Type) { try { IAddressModel objAdd = null; int LoginID = GetLogin(); if (LoginID > 0) { if (Type == "billing") { objAdd = objUDSvc.GetBillingAddressByID(AddressID); } else if (Type == "shipping") { objAdd = objUDSvc.GetShippingAddressByID(AddressID); } return(Json(new Response { IsSuccess = true, Message = "200", Result = objAdd }, JsonRequestBehavior.AllowGet)); } return(Json(new Response { Code = 200, IsSuccess = false, Message = string.Format(StringResource.Invalid, "Session") }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { ErrorLog.Log("HomeController", "GetByAddressID", ex); return(Json(new Response { IsSuccess = false, Message = ex.Message }, JsonRequestBehavior.AllowGet)); } }
public IResponse <IAddressModel, AddressResponse> CreateAddress(IAddressModel request) { Logger.Here().Information("BGN"); Logger.Here().Information("END"); return(null); }
public void SetModel(IAddressModel model) { this.AddressModel = (IAddressModel)model; if (!string.IsNullOrEmpty(this.AddressModel.Notes)) { ShipComments.Text = AddressModel.Notes; } }
private Uri CreateDestinationUri(IAddressModel address, string path) { var scheme = "ws"; if (_webSocketOptions.IsSsl) { scheme = "wss"; } var wsAddress = $"{scheme}://{address.Address}:{address.Port}{path}"; return(new Uri(wsAddress)); }
protected void DataListAddressBook_OnItemDataBound(object source, DataListItemEventArgs args) { if ((args.Item.ItemType == ListItemType.Item) || (args.Item.ItemType == ListItemType.AlternatingItem)) { IAddressModel model = (IAddressModel)args.Item.DataItem; var addressView = (OPCUserControl <IAddressModel>)args.Item.FindControl("AddressStaticItem"); addressView.SetModel(model, StringResourceProvider); addressView.Enable(); addressView.Show(); addressView.BindView(); } }
private void MarkAddressFail(GovernanceOptions governanceOptions, IAddressModel selectedAddress, bool isTimeoutEx = false) { if (governanceOptions.FuseProtection) { selectedAddress.MakeFusing(governanceOptions.FuseSleepDuration); if (selectedAddress.FuseTimes > governanceOptions.FuseTimes && !isTimeoutEx) { _healthCheck.ChangeHealthStatus(selectedAddress, false, governanceOptions.FuseTimes); } } else if (!isTimeoutEx) { _healthCheck.ChangeHealthStatus(selectedAddress, false); } }
private void ConfigurePrimaryBillingAddress() { IAddressModel address = this.AccountModel.AddressBook .FirstOrDefault(abm => abm.AddressId != this.AccountModel.PrimaryShippingAddressId); if (address != null) { // set the billing address id to the first non-shipping address found. this.AccountModel.PrimaryBillingAddressId = address.AddressId; } else { // set to zero, which will force the creation of an address this.AccountModel.PrimaryBillingAddressId = "0"; } }
public DotNettyTcpServerMessageListener(IOptions <RpcOptions> rpcOptions, IHostEnvironment hostEnvironment, ITransportMessageDecoder transportMessageDecoder, IHealthCheck healthCheck) { _hostEnvironment = hostEnvironment; _transportMessageDecoder = transportMessageDecoder; _healthCheck = healthCheck; _rpcOptions = rpcOptions.Value; _hostAddress = NetUtil.GetRpcAddressModel(); if (_rpcOptions.IsSsl) { Check.NotNullOrEmpty(_rpcOptions.SslCertificateName, nameof(_rpcOptions.SslCertificateName)); } Logger = NullLogger <DotNettyTcpServerMessageListener> .Instance; }
public void SetModel(IAddressModel model) { this.AddressModel = (IAddressModel)model; }
public void SetModel(IAddressModel model) { this.AddressModel = (Vortx.OnePageCheckout.Models.IAddressModel)model; }