static void Main(string[] args) { PushServer server = new PushServer(); server.Start(); while (true) { Console.Clear(); Console.WriteLine("{0}", DateTime.Now); Thread.Sleep(1000); } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { PushServer.Start(); if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseCors(builder => builder .AllowAnyOrigin() .AllowAnyHeader() .AllowAnyMethod() ); app.UseMvc(); }
protected override void OnStart(string[] args) { server = builder.Build(Port, MaxConnect); server.Start(); //Program.Start(args); }