public static void StartService() { try { //DeliveryNote d = new DeliveryNote(); //d.foremanid = 1; //d.orderid = 4; //d.success = true; //DbHandler.addDeliveryNote(d); // //foreach (Order o in orders) { // Console.WriteLine(o.Terminal); //} //List<DeliveryNote> notes = DbHandler.GetDeliveryNotes(); //foreach(DeliveryNote d in notes) //{ // Console.WriteLine(d.orderid); //} int port = 50000; service = new AsyncService(port); service.Run(); Console.ReadLine(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadLine(); } }
protected override void OnStart(string[] args) { int port = 8001; AsyncService service = new AsyncService(port, new CalcHandler()); service.Run(); }
private void Start() { try { int port = 5000; AsyncService service = new AsyncService(port, this); service.Run(); // very specific service } catch (Exception ex) { Debug.Log(ex.Message); } }
static void Main(string[] args) { try { AsyncService service = new AsyncService(); service.Run(); Console.ReadLine(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadLine(); } }
static void Main(string[] args) { try { AsyncService service = new AsyncService(); service.Run(); while (true) { Console.WriteLine("Long Task\n\r"); Thread.Sleep(1000); } } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadLine(); } }