public static void StartOnAzure(this IXSocketServerContainer container) { //Configurations var configs = new List <IConfigurationSetting>(); var uriStr = RoleEnvironment.GetConfigurationSettingValue("uri"); var origins = new HashSet <string>(RoleEnvironment.GetConfigurationSettingValue("origin").Split(',').ToList()); var instanceEndpoints = RoleEnvironment.CurrentRoleInstance.InstanceEndpoints.Values.Where(p => p.Protocol.Equals("tcp")); //Create endpoints foreach (var endpoint in instanceEndpoints) { var uri = new Uri(uriStr.Replace("port", endpoint.IPEndpoint.Port.ToString(CultureInfo.InvariantCulture))); configs.Add(new ConfigurationSetting(uri, origins) { Endpoint = endpoint.IPEndpoint }); Composable.GetExport <IXLogger>().Information("Endpoint {@endpoint}", endpoint); } if (!configs.Any()) { Composable.GetExport <IXLogger>().Fatal("Could not find a TCP endpoint, check your configuration"); return; } //Start server with endpoints container.Start(false, configurationSettings: configs); }
public Instance() { wss = Plugin.Framework.Composable.GetExport <IXSocketServerContainer>(); wss.Start(withInterceptors: true, configurationSettings: new List <IConfigurationSetting> { new ConfigurationLoader() }); }
public static void Start() { //Register the WCF-service RouteTable.Routes.Add(new ServiceRoute("ZooService", new WebServiceHostFactory(), typeof(ZooService))); //Start XSockets container = XSockets.Plugin.Framework.Composable.GetExport<IXSocketServerContainer>(); container.Start(); }
public static void Start() { //Register the WCF-service RouteTable.Routes.Add(new ServiceRoute("ZooService", new WebServiceHostFactory(), typeof(ZooService))); //Start XSockets container = XSockets.Plugin.Framework.Composable.GetExport <IXSocketServerContainer>(); container.Start(); }
public override bool OnStart() { bool result = base.OnStart(); //Get the server container _container = Composable.GetExport<IXSocketServerContainer>(); //Start in worker role _container.StartOnAzure(); return result; }
public override bool OnStart() { bool result = base.OnStart(); //Get the server container _container = Composable.GetExport <IXSocketServerContainer>(); //Start in worker role _container.StartOnAzure(); return(result); }
public override bool OnStart() { bool result = base.OnStart(); // Use the XSockets.NET Plugin Framwork to get an IXSocketServerContainer _container = Composable.GetExport<IXSocketServerContainer>(); //Start server by using extension (see ConfigurationHelper) _container.StartOnAzure(); return result; }
public override bool OnStart() { bool result = base.OnStart(); // Use the XSockets.NET Plugin Framwork to get an IXSocketServerContainer _container = Composable.GetExport <IXSocketServerContainer>(); //Start server by using extension (see ConfigurationHelper) _container.StartOnAzure(); return(result); }
public static void Start() { container = XSockets.Plugin.Framework.Composable.GetExport <IXSocketServerContainer>(); container.Start(); //// You can also add custom confgurations at startup. //var configs = new List<IConfigurationSetting>(); //for (var i = 83; i <= 85; i++) //{ // configs.Add(new ConfigurationSetting("ws://localhost:" + i)); //} //container.Start(configurationSettings: configs); }
public static void Start() { container = XSockets.Plugin.Framework.Composable.GetExport<IXSocketServerContainer>(); container.Start(); //// You can also add custom confgurations at startup. //var configs = new List<IConfigurationSetting>(); //for (var i = 83; i <= 85; i++) //{ // configs.Add(new ConfigurationSetting("ws://localhost:" + i)); //} //container.Start(configurationSettings: configs); }
public static void Start() { wss = XSockets.Plugin.Framework.Composable.GetExport<IXSocketServerContainer>(); wss.StartServers(); foreach (var server in wss.Servers) { Debug.WriteLine("Started Server: {0}:{1}", server.ConfigurationSetting.Location, server.ConfigurationSetting.Port); Debug.WriteLine("Scheme: {0}", server.ConfigurationSetting.Scheme); Debug.WriteLine("SSL/TLS: {0}", server.ConfigurationSetting.IsSecure); Debug.WriteLine("Allowed Connections (0 = infinite): {0}", server.ConfigurationSetting.NumberOfAllowedConections); Debug.WriteLine("------------------------------------------------------"); } }
public override bool OnStart() { // Set the maximum number of concurrent connections ServicePointManager.DefaultConnectionLimit = 12; // For information on handling configuration changes // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357. bool result = base.OnStart(); Trace.TraceInformation("HackService has been started"); container = Composable.GetExport<IXSocketServerContainer>(); container.StartOnAzure(); return result; }
public static void Start() { container = XSockets.Plugin.Framework.Composable.GetExport<IXSocketServerContainer>(); container.Start(); }
private void publishbutton_Click(object sender, EventArgs e) { _timer = new System.Timers.Timer(5000); client = new XSocketClient("ws://127.0.0.1:4503/MyController", "*"); client.Bind("foo2", OnFoo); if(client.IsConnected == false) { _timer.Elapsed += new ElapsedEventHandler(_timer_Elapsed); _timer.Enabled = true; } server = XSockets.Plugin.Framework.Composable.GetExport<IXSocketServerContainer>(); server.OnServerClientConnection += SocketOnOnOpen; server.StartServers(); XSocketJsonSerializer json = new XSocketJsonSerializer(); Random r = new Random(); EquityPrice ep = new EquityPrice(); ep.open = 14; ep.high = 356; ep.low = 257; ep.close = 23; //Console.WriteLine("Started, hit enter to quit"); //Console.ReadLine(); while(true) { ep.code = "0005.HK"; ep.open = ep.open + Convert.ToDecimal(Math.Round(r.NextDouble(), 2)); ep.high = ep.high + Convert.ToDecimal(Math.Round(r.NextDouble(), 2)); ep.low = ep.low + Convert.ToDecimal(Math.Round(r.NextDouble(), 2)); ep.close = ep.close + Convert.ToDecimal(Math.Round(r.NextDouble(), 2)); SendEventMessageToAllClients(json.SerializeToString(ep)); //SendEventMessageToAllClients("hello "+i.ToString()); //Thread.Sleep(2000); } server.StopServers(); //.Send(new { SomeString = "Demo", SomeNumber = 123 }, "foo"); }
public static void Start() { container = XSockets.Plugin.Framework.Composable.GetExport <IXSocketServerContainer>(); container.Start(); }
public XSocketsBoostrap() { Wss = XSockets.Plugin.Framework.Composable.GetExport <IXSocketServerContainer>(); }
public Instance() { wss = Plugin.Framework.Composable.GetExport<IXSocketServerContainer>(); wss.Start(withInterceptors:true, configurationSettings: new List<IConfigurationSetting>{ new ConfigurationLoader()}); }
public static void Start() { container = Composable.GetExport<IXSocketServerContainer>(); container.Start(); }
public XSocketsBoostrap() { Wss = XSockets.Plugin.Framework.Composable.GetExport<IXSocketServerContainer>(); }
public void Configuration(IAppBuilder app) { container = Composable.GetExport <IXSocketServerContainer>(); container.Start(); }
public void Configuration(IAppBuilder app) { container = Composable.GetExport<IXSocketServerContainer>(); container.Start(); }