Esempio n. 1
0
 private static void ThreadPoolEnqueue(Client client, Action action)
 {
     ThreadPool.QueueUserWorkItem(
         o =>
     {
         try
         {
             action();
         }
         catch (Exception e)
         {
             client.HandleException(e);
         }
     });
 }
Esempio n. 2
0
 /////// <summary>
 /////// The receive event.
 /////// </summary>
 /////// <param name="client">
 /////// The client.
 /////// </param>
 /////// <param name="eventCode">
 /////// The event code.
 /////// </param>
 /////// <param name="checkAction">
 /////// The check action.
 /////// </param>
 /////// <returns>
 /////// </returns>
 ////private static Hashtable ReceiveEvent(Client client, Code eventCode, Func<Hashtable, bool> checkAction)
 ////{
 ////    BeginReceiveEvent(client, eventCode, checkAction);
 ////    return EndReceiveEvent(client);
 ////}
 /////// <summary>
 /////// The receive event.
 /////// </summary>
 /////// <param name="client">
 /////// The client.
 /////// </param>
 /////// <param name="eventCode">
 /////// The event code.
 /////// </param>
 /////// <returns>
 /////// </returns>
 ////private static Hashtable ReceiveEvent(Client client, Code eventCode)
 ////{
 ////    return ReceiveEvent(client, eventCode, d => true);
 ////}
 /// <summary>
 ///   The thread pool enqueue.
 /// </summary>
 /// <param name = "client">
 ///   The client.
 /// </param>
 /// <param name = "action">
 ///   The action.
 /// </param>
 private static void ThreadPoolEnqueue(Client client, Action action)
 {
     ThreadPool.QueueUserWorkItem(
         o =>
             {
                 try
                 {
                     action();
                 }
                 catch (Exception e)
                 {
                     client.HandleException(e);
                 }
             });
 }