Beispiel #1
0
 public override void initEvent(string clientUUID, ServerEventPrx serverEvent, Current current)
 {
     clients.Add(((ServerEventPrxHelper)serverEvent));
     eventService.DoClientConnect(clientUUID).Wait();
     current.con.setCloseCallback(async(con) =>
     {
         await Task.Yield();
         logger.LogInformation($"{serverEvent.GetHashCode()}");
         clients.Remove((ServerEventPrxHelper)serverEvent);
         await eventService.DoClientDisConnect(clientUUID);
     });
     // var service = lib.Provider.serviceProvider.GetRequiredService<Service.EventService>();
     // var task = service.DoTreeListUpdate();
     // Task.Run(async () =>
     // {
     //     while (true)
     //     {
     //         try
     //         {
     //             ((ServerEventPrxHelper)serverEvent).TreeListUpdate();
     //             await Task.Delay(6000);
     //         }
     //         catch (Exception ex)
     //         {
     //             logger.LogError(ex.Message);
     //             throw ex;
     //         }
     //     }
     // });
     logger.LogInformation($"{serverEvent.GetHashCode()}");
 }