[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

neo [mvp outlook]

10/20/2004 11:03:00 PM

Hi, I had a question about how to remove invalid clients suscribed to the
events,
on one sugested article i found the answer, but there is a strange thing
happening,
some remote objects remove correctly the clients, but another ones throw an
exception as: No connection could be made because the target machine actively
refused it.
Here is the code of one that works:

using System;
using KernelMessage;

namespace Level2.L2Kernel
{
public enum ScheduleCommand
{
BuildSchedule,
ChangeGrade,
Save
}

/// <summary>
/// This is the remote class that has the schedule data structure
/// </summary>
public class Schedule: MarshalByRefObject, IRemoteObj
{
public event StreamUpdatedEventHandler StreamUpdated;
public event CommandReceivedEventHandler CommandReceived;

#region Fields

byte[] _scheduleStream;

#endregion

#region Constructors

/// <summary>
/// This constructor has the byte array for the buckets composite
/// </summary>
public Schedule(byte[] scheduleStream)
{
this._scheduleStream = scheduleStream;
}

public Schedule()
{
}

#endregion

#region Methods


/// <summary>
/// Simple method called by remote clients so they can verify their
instances live.
/// </summary>
/// <returns></returns>
public bool verifyConnection()
{
return true;
}

/// <summary>
/// This method is for getting the remote bucket stream.
/// </summary>
/// <returns>
/// byte[] Its an array of bytes that represents the bucket
/// array serialized
/// </returns>
public byte[] getRemoteStream()
{
return this._scheduleStream;
}


/// <summary>
/// This method overwrites the remote schedule with the new one, and it
/// sends an event to the clients, so the can receive the new schedule.
/// </summary>
/// <param name="scheduleStream">Contains the schedule serialized</param>
/// <returns></returns>
public void setRemoteStream(byte[] scheduleStream)
{
this._scheduleStream = scheduleStream;
try
{
foreach(System.Delegate __delegate in StreamUpdated.GetInvocationList())
{
try
{
__delegate.Method.Invoke(__delegate.Target, new Object[] {"Schedule",
(byte[])scheduleStream.Clone()});
}
catch( Exception e )
{
Logger.Write(e.Message, System.Diagnostics.EventLogEntryType.Warning);
StreamUpdated = (StreamUpdatedEventHandler)
System.Delegate.Remove(StreamUpdated, __delegate);
Logger.Write("Schedule: Invalid remote client removed =)");
}
}
}
catch
{
Logger.Write("There is no client connected to schedule");
}
}


/// <summary>
/// This method sends an event to the server telling it to add a specific
/// number of heat orders, with a spesific grade.
/// </summary>
/// <param name="initialHeat"></param>
/// <param name="heatCount"></param>
/// <param name="grade"></param>
public void SetSchedule(int heatCount, string grade, float plannedWt)
{
if (CommandReceived != null)
{
try
{
Composite __params = new Composite();
__params.Properties["heatCount"] = heatCount.ToString();
__params.Properties["grade"] = grade;
__params.Properties["plannedWt"] = plannedWt.ToString();

CommandReceived((int)ScheduleCommand.BuildSchedule,
FrameHandler.Serialize(__params));
}
catch( Exception e )
{
Logger.Write("Failed to fire server event: " + e.Message +
" Stack: " + e.StackTrace);
}
}
}


/// <summary>
/// This method sends an event to the server telling it to change the
grade for
/// a specific heat order.
/// </summary>
/// <param name="heatNum"></param>
/// <param name="grade"></param>
public void ChangeHeatGrade(int heatNum, string grade)
{
if (CommandReceived != null)
{
try
{
Composite __params = new Composite();
__params.Properties["heatNum"] = heatNum.ToString();
__params.Properties["grade"] = grade;

CommandReceived((int)ScheduleCommand.ChangeGrade,
FrameHandler.Serialize(__params));
}
catch( Exception e )
{
Logger.Write("Failed to fire server event: " + e.Message +
" Stack: " + e.StackTrace);
}
}
}

/// <summary>
/// This override ensures that if the object is idle for an extended
/// period, waiting for messages, it won't lose its lease.
/// </summary>
public override object InitializeLifetimeService()
{
return null;
}

#endregion
}
}


And this is one that works correct.

using System;
using KernelMessage;

namespace Level2.L2Kernel
{

public enum GICommand
{
AddVariable,
SetOperator,
Save
}

/// <summary>
/// System General Info.
/// </summary>
public class GeneralInfo: MarshalByRefObject, IRemoteObj
{
public event StreamUpdatedEventHandler StreamUpdated;
public event CommandReceivedEventHandler CommandReceived;

#region Fields

byte[] _giStream;

#endregion


#region Constructors

public GeneralInfo(byte[] giStream)
{
this._giStream = giStream;
}

public GeneralInfo()
{
}

#endregion


#region Methods

/// <summary>
/// Simple method called by remote clients so they can verify their
instances life.
/// </summary>
/// <returns></returns>
public bool verifyConnection()
{
return true;
}

/// <summary>
/// This method is for getting the remote stream.
/// </summary>
/// <returns>
/// byte[] Its an array of bytes that represents the information
/// array serialized
/// </returns>
public byte[] getRemoteStream()
{
return this._giStream;
}


/// <summary>
/// This method overwrites the remote info array with the new one, and it
/// sends an event to the clients, so the can receive the new info array.
/// </summary>
/// <param name="giStream">Contains the info array serialized</param>
/// <returns></returns>
public void setRemoteStream(byte[] giStream)
{
this._giStream = giStream;

try
{
foreach(System.Delegate __delegate in StreamUpdated.GetInvocationList())
{
try
{
__delegate.Method.Invoke(__delegate.Target, new Object[]
{"GeneralInfo", (byte[])giStream.Clone()});
}
catch( Exception e )
{
Logger.Write("General Info: " + e.Message,
System.Diagnostics.EventLogEntryType.Warning);

try
{
StreamUpdated = (StreamUpdatedEventHandler)
System.Delegate.Remove(StreamUpdated, __delegate);

Logger.Write("General Info: Invalid remote client removed :) " +
__delegate.Target.ToString());
}
catch(Exception ex)
{
Logger.Write("General Info: Unable to remove invalid client :( " +
ex.Message,
System.Diagnostics.EventLogEntryType.Warning);
}
}
}
}
catch
{
}
}

/// <summary>
/// This method sends a command to the server for setting the operator.
/// </summary>
/// <param name="oper"></param>
public void SetOperator(string oper)
{
if (CommandReceived != null)
{
try
{
Composite __params = new Composite();
__params.Properties["Operator"] = oper;

CommandReceived((int)GICommand.SetOperator,
FrameHandler.Serialize(__params));
}
catch( Exception e )
{
Logger.Write("Failed to fire server event: " + e.Message +
" Stack: " + e.StackTrace);
}
}
}


/// <summary>
/// This override ensures that if the object is idle for an extended
/// period, waiting for messages, it won't lose its lease.
/// </summary>
public override object InitializeLifetimeService()
{
return null;
}

#endregion

}
}


3 Answers

neo [mvp outlook]

10/20/2004 11:13:00 PM

0


Sorry, the second class throws the exception.

Ken Kolda

10/20/2004 11:19:00 PM

0

In the second set of code you remove the delegate from the event handler and
then have this line of code:

Logger.Write("General Info: Invalid remote client removed :) " +
__delegate.Target.ToString());

Remember that the __delegate.Target property refers to the remote object
which has disconnected (after all, that's what calling the delegate failed,
right?). So when you call ToString() on this object, it attempts to connect
to the remote object (again) and fails, which is why you get the message.
Just remove this code and you should be OK.

By the way, in C# the more common/shorthand way of removing a delegate from
an event handler is:

StreamUpdated -= __delegate;

The syntax:

StreamUpdated = (StreamUpdatedEventHandler)
System.Delegate.Remove(StreamUpdated, __delegate);

is more like what you would write in VB.NET to remove a delegate.

Ken


"Neo" <Neo@discussions.microsoft.com> wrote in message
news:50A8AFB2-7274-4E3C-AE09-2ACADC92C15A@microsoft.com...
> Hi, I had a question about how to remove invalid clients suscribed to the
> events,
> on one sugested article i found the answer, but there is a strange thing
> happening,
> some remote objects remove correctly the clients, but another ones throw
an
> exception as: No connection could be made because the target machine
actively
> refused it.
> Here is the code of one that works:
>
> using System;
> using KernelMessage;
>
> namespace Level2.L2Kernel
> {
> public enum ScheduleCommand
> {
> BuildSchedule,
> ChangeGrade,
> Save
> }
>
> /// <summary>
> /// This is the remote class that has the schedule data structure
> /// </summary>
> public class Schedule: MarshalByRefObject, IRemoteObj
> {
> public event StreamUpdatedEventHandler StreamUpdated;
> public event CommandReceivedEventHandler CommandReceived;
>
> #region Fields
>
> byte[] _scheduleStream;
>
> #endregion
>
> #region Constructors
>
> /// <summary>
> /// This constructor has the byte array for the buckets composite
> /// </summary>
> public Schedule(byte[] scheduleStream)
> {
> this._scheduleStream = scheduleStream;
> }
>
> public Schedule()
> {
> }
>
> #endregion
>
> #region Methods
>
>
> /// <summary>
> /// Simple method called by remote clients so they can verify their
> instances live.
> /// </summary>
> /// <returns></returns>
> public bool verifyConnection()
> {
> return true;
> }
>
> /// <summary>
> /// This method is for getting the remote bucket stream.
> /// </summary>
> /// <returns>
> /// byte[] Its an array of bytes that represents the bucket
> /// array serialized
> /// </returns>
> public byte[] getRemoteStream()
> {
> return this._scheduleStream;
> }
>
>
> /// <summary>
> /// This method overwrites the remote schedule with the new one, and it
> /// sends an event to the clients, so the can receive the new schedule.
> /// </summary>
> /// <param name="scheduleStream">Contains the schedule serialized</param>
> /// <returns></returns>
> public void setRemoteStream(byte[] scheduleStream)
> {
> this._scheduleStream = scheduleStream;
> try
> {
> foreach(System.Delegate __delegate in StreamUpdated.GetInvocationList())
> {
> try
> {
> __delegate.Method.Invoke(__delegate.Target, new Object[] {"Schedule",
> (byte[])scheduleStream.Clone()});
> }
> catch( Exception e )
> {
> Logger.Write(e.Message, System.Diagnostics.EventLogEntryType.Warning);
> StreamUpdated = (StreamUpdatedEventHandler)
> System.Delegate.Remove(StreamUpdated, __delegate);
> Logger.Write("Schedule: Invalid remote client removed =)");
> }
> }
> }
> catch
> {
> Logger.Write("There is no client connected to schedule");
> }
> }
>
>
> /// <summary>
> /// This method sends an event to the server telling it to add a specific
> /// number of heat orders, with a spesific grade.
> /// </summary>
> /// <param name="initialHeat"></param>
> /// <param name="heatCount"></param>
> /// <param name="grade"></param>
> public void SetSchedule(int heatCount, string grade, float plannedWt)
> {
> if (CommandReceived != null)
> {
> try
> {
> Composite __params = new Composite();
> __params.Properties["heatCount"] = heatCount.ToString();
> __params.Properties["grade"] = grade;
> __params.Properties["plannedWt"] = plannedWt.ToString();
>
> CommandReceived((int)ScheduleCommand.BuildSchedule,
> FrameHandler.Serialize(__params));
> }
> catch( Exception e )
> {
> Logger.Write("Failed to fire server event: " + e.Message +
> " Stack: " + e.StackTrace);
> }
> }
> }
>
>
> /// <summary>
> /// This method sends an event to the server telling it to change the
> grade for
> /// a specific heat order.
> /// </summary>
> /// <param name="heatNum"></param>
> /// <param name="grade"></param>
> public void ChangeHeatGrade(int heatNum, string grade)
> {
> if (CommandReceived != null)
> {
> try
> {
> Composite __params = new Composite();
> __params.Properties["heatNum"] = heatNum.ToString();
> __params.Properties["grade"] = grade;
>
> CommandReceived((int)ScheduleCommand.ChangeGrade,
> FrameHandler.Serialize(__params));
> }
> catch( Exception e )
> {
> Logger.Write("Failed to fire server event: " + e.Message +
> " Stack: " + e.StackTrace);
> }
> }
> }
>
> /// <summary>
> /// This override ensures that if the object is idle for an extended
> /// period, waiting for messages, it won't lose its lease.
> /// </summary>
> public override object InitializeLifetimeService()
> {
> return null;
> }
>
> #endregion
> }
> }
>
>
> And this is one that works correct.
>
> using System;
> using KernelMessage;
>
> namespace Level2.L2Kernel
> {
>
> public enum GICommand
> {
> AddVariable,
> SetOperator,
> Save
> }
>
> /// <summary>
> /// System General Info.
> /// </summary>
> public class GeneralInfo: MarshalByRefObject, IRemoteObj
> {
> public event StreamUpdatedEventHandler StreamUpdated;
> public event CommandReceivedEventHandler CommandReceived;
>
> #region Fields
>
> byte[] _giStream;
>
> #endregion
>
>
> #region Constructors
>
> public GeneralInfo(byte[] giStream)
> {
> this._giStream = giStream;
> }
>
> public GeneralInfo()
> {
> }
>
> #endregion
>
>
> #region Methods
>
> /// <summary>
> /// Simple method called by remote clients so they can verify their
> instances life.
> /// </summary>
> /// <returns></returns>
> public bool verifyConnection()
> {
> return true;
> }
>
> /// <summary>
> /// This method is for getting the remote stream.
> /// </summary>
> /// <returns>
> /// byte[] Its an array of bytes that represents the information
> /// array serialized
> /// </returns>
> public byte[] getRemoteStream()
> {
> return this._giStream;
> }
>
>
> /// <summary>
> /// This method overwrites the remote info array with the new one, and it
> /// sends an event to the clients, so the can receive the new info array.
> /// </summary>
> /// <param name="giStream">Contains the info array serialized</param>
> /// <returns></returns>
> public void setRemoteStream(byte[] giStream)
> {
> this._giStream = giStream;
>
> try
> {
> foreach(System.Delegate __delegate in StreamUpdated.GetInvocationList())
> {
> try
> {
> __delegate.Method.Invoke(__delegate.Target, new Object[]
> {"GeneralInfo", (byte[])giStream.Clone()});
> }
> catch( Exception e )
> {
> Logger.Write("General Info: " + e.Message,
> System.Diagnostics.EventLogEntryType.Warning);
>
> try
> {
> StreamUpdated = (StreamUpdatedEventHandler)
> System.Delegate.Remove(StreamUpdated, __delegate);
>
> Logger.Write("General Info: Invalid remote client removed :) " +
> __delegate.Target.ToString());
> }
> catch(Exception ex)
> {
> Logger.Write("General Info: Unable to remove invalid client :( " +
> ex.Message,
> System.Diagnostics.EventLogEntryType.Warning);
> }
> }
> }
> }
> catch
> {
> }
> }
>
> /// <summary>
> /// This method sends a command to the server for setting the operator.
> /// </summary>
> /// <param name="oper"></param>
> public void SetOperator(string oper)
> {
> if (CommandReceived != null)
> {
> try
> {
> Composite __params = new Composite();
> __params.Properties["Operator"] = oper;
>
> CommandReceived((int)GICommand.SetOperator,
> FrameHandler.Serialize(__params));
> }
> catch( Exception e )
> {
> Logger.Write("Failed to fire server event: " + e.Message +
> " Stack: " + e.StackTrace);
> }
> }
> }
>
>
> /// <summary>
> /// This override ensures that if the object is idle for an extended
> /// period, waiting for messages, it won't lose its lease.
> /// </summary>
> public override object InitializeLifetimeService()
> {
> return null;
> }
>
> #endregion
>
> }
> }
>
>


neo [mvp outlook]

10/21/2004 2:29:00 PM

0

Hey thanks a lot!

I can't believe I didn't see it...

I appreciate a lot your help. =)

"Ken Kolda" wrote:

> In the second set of code you remove the delegate from the event handler and
> then have this line of code:
>
> Logger.Write("General Info: Invalid remote client removed :) " +
> __delegate.Target.ToString());
>
> Remember that the __delegate.Target property refers to the remote object
> which has disconnected (after all, that's what calling the delegate failed,
> right?). So when you call ToString() on this object, it attempts to connect
> to the remote object (again) and fails, which is why you get the message.
> Just remove this code and you should be OK.
>
> By the way, in C# the more common/shorthand way of removing a delegate from
> an event handler is:
>
> StreamUpdated -= __delegate;
>
> The syntax:
>
> StreamUpdated = (StreamUpdatedEventHandler)
> System.Delegate.Remove(StreamUpdated, __delegate);
>
> is more like what you would write in VB.NET to remove a delegate.
>
> Ken
>
>
> "Neo" <Neo@discussions.microsoft.com> wrote in message
> news:50A8AFB2-7274-4E3C-AE09-2ACADC92C15A@microsoft.com...
> > Hi, I had a question about how to remove invalid clients suscribed to the
> > events,
> > on one sugested article i found the answer, but there is a strange thing
> > happening,
> > some remote objects remove correctly the clients, but another ones throw
> an
> > exception as: No connection could be made because the target machine
> actively
> > refused it.
> > Here is the code of one that works:
> >
> > using System;
> > using KernelMessage;
> >
> > namespace Level2.L2Kernel
> > {
> > public enum ScheduleCommand
> > {
> > BuildSchedule,
> > ChangeGrade,
> > Save
> > }
> >
> > /// <summary>
> > /// This is the remote class that has the schedule data structure
> > /// </summary>
> > public class Schedule: MarshalByRefObject, IRemoteObj
> > {
> > public event StreamUpdatedEventHandler StreamUpdated;
> > public event CommandReceivedEventHandler CommandReceived;
> >
> > #region Fields
> >
> > byte[] _scheduleStream;
> >
> > #endregion
> >
> > #region Constructors
> >
> > /// <summary>
> > /// This constructor has the byte array for the buckets composite
> > /// </summary>
> > public Schedule(byte[] scheduleStream)
> > {
> > this._scheduleStream = scheduleStream;
> > }
> >
> > public Schedule()
> > {
> > }
> >
> > #endregion
> >
> > #region Methods
> >
> >
> > /// <summary>
> > /// Simple method called by remote clients so they can verify their
> > instances live.
> > /// </summary>
> > /// <returns></returns>
> > public bool verifyConnection()
> > {
> > return true;
> > }
> >
> > /// <summary>
> > /// This method is for getting the remote bucket stream.
> > /// </summary>
> > /// <returns>
> > /// byte[] Its an array of bytes that represents the bucket
> > /// array serialized
> > /// </returns>
> > public byte[] getRemoteStream()
> > {
> > return this._scheduleStream;
> > }
> >
> >
> > /// <summary>
> > /// This method overwrites the remote schedule with the new one, and it
> > /// sends an event to the clients, so the can receive the new schedule.
> > /// </summary>
> > /// <param name="scheduleStream">Contains the schedule serialized</param>
> > /// <returns></returns>
> > public void setRemoteStream(byte[] scheduleStream)
> > {
> > this._scheduleStream = scheduleStream;
> > try
> > {
> > foreach(System.Delegate __delegate in StreamUpdated.GetInvocationList())
> > {
> > try
> > {
> > __delegate.Method.Invoke(__delegate.Target, new Object[] {"Schedule",
> > (byte[])scheduleStream.Clone()});
> > }
> > catch( Exception e )
> > {
> > Logger.Write(e.Message, System.Diagnostics.EventLogEntryType.Warning);
> > StreamUpdated = (StreamUpdatedEventHandler)
> > System.Delegate.Remove(StreamUpdated, __delegate);
> > Logger.Write("Schedule: Invalid remote client removed =)");
> > }
> > }
> > }
> > catch
> > {
> > Logger.Write("There is no client connected to schedule");
> > }
> > }
> >
> >
> > /// <summary>
> > /// This method sends an event to the server telling it to add a specific
> > /// number of heat orders, with a spesific grade.
> > /// </summary>
> > /// <param name="initialHeat"></param>
> > /// <param name="heatCount"></param>
> > /// <param name="grade"></param>
> > public void SetSchedule(int heatCount, string grade, float plannedWt)
> > {
> > if (CommandReceived != null)
> > {
> > try
> > {
> > Composite __params = new Composite();
> > __params.Properties["heatCount"] = heatCount.ToString();
> > __params.Properties["grade"] = grade;
> > __params.Properties["plannedWt"] = plannedWt.ToString();
> >
> > CommandReceived((int)ScheduleCommand.BuildSchedule,
> > FrameHandler.Serialize(__params));
> > }
> > catch( Exception e )
> > {
> > Logger.Write("Failed to fire server event: " + e.Message +
> > " Stack: " + e.StackTrace);
> > }
> > }
> > }
> >
> >
> > /// <summary>
> > /// This method sends an event to the server telling it to change the
> > grade for
> > /// a specific heat order.
> > /// </summary>
> > /// <param name="heatNum"></param>
> > /// <param name="grade"></param>
> > public void ChangeHeatGrade(int heatNum, string grade)
> > {
> > if (CommandReceived != null)
> > {
> > try
> > {
> > Composite __params = new Composite();
> > __params.Properties["heatNum"] = heatNum.ToString();
> > __params.Properties["grade"] = grade;
> >
> > CommandReceived((int)ScheduleCommand.ChangeGrade,
> > FrameHandler.Serialize(__params));
> > }
> > catch( Exception e )
> > {
> > Logger.Write("Failed to fire server event: " + e.Message +
> > " Stack: " + e.StackTrace);
> > }
> > }
> > }
> >
> > /// <summary>
> > /// This override ensures that if the object is idle for an extended
> > /// period, waiting for messages, it won't lose its lease.
> > /// </summary>
> > public override object InitializeLifetimeService()
> > {
> > return null;
> > }
> >
> > #endregion
> > }
> > }
> >
> >
> > And this is one that works correct.
> >
> > using System;
> > using KernelMessage;
> >
> > namespace Level2.L2Kernel
> > {
> >
> > public enum GICommand
> > {
> > AddVariable,
> > SetOperator,
> > Save
> > }
> >
> > /// <summary>
> > /// System General Info.
> > /// </summary>
> > public class GeneralInfo: MarshalByRefObject, IRemoteObj
> > {
> > public event StreamUpdatedEventHandler StreamUpdated;
> > public event CommandReceivedEventHandler CommandReceived;
> >
> > #region Fields
> >
> > byte[] _giStream;
> >
> > #endregion
> >
> >
> > #region Constructors
> >
> > public GeneralInfo(byte[] giStream)
> > {
> > this._giStream = giStream;
> > }
> >
> > public GeneralInfo()
> > {
> > }
> >
> > #endregion
> >
> >
> > #region Methods
> >
> > /// <summary>
> > /// Simple method called by remote clients so they can verify their
> > instances life.
> > /// </summary>
> > /// <returns></returns>
> > public bool verifyConnection()
> > {
> > return true;
> > }
> >
> > /// <summary>
> > /// This method is for getting the remote stream.
> > /// </summary>
> > /// <returns>
> > /// byte[] Its an array of bytes that represents the information
> > /// array serialized
> > /// </returns>
> > public byte[] getRemoteStream()
> > {
> > return this._giStream;
> > }
> >
> >
> > /// <summary>
> > /// This method overwrites the remote info array with the new one, and it
> > /// sends an event to the clients, so the can receive the new info array.
> > /// </summary>
> > /// <param name="giStream">Contains the info array serialized</param>
> > /// <returns></returns>
> > public void setRemoteStream(byte[] giStream)
> > {
> > this._giStream = giStream;
> >
> > try
> > {
> > foreach(System.Delegate __delegate in StreamUpdated.GetInvocationList())
> > {
> > try
> > {
> > __delegate.Method.Invoke(__delegate.Target, new Object[]
> > {"GeneralInfo", (byte[])giStream.Clone()});
> > }
> > catch( Exception e )
> > {
> > Logger.Write("General Info: " + e.Message,
> > System.Diagnostics.EventLogEntryType.Warning);
> >
> > try
> > {
> > StreamUpdated = (StreamUpdatedEventHandler)
> > System.Delegate.Remove(StreamUpdated, __delegate);
> >
> > Logger.Write("General Info: Invalid remote client removed :) " +
> > __delegate.Target.ToString());
> > }
> > catch(Exception ex)
> > {
> > Logger.Write("General Info: Unable to remove invalid client :( " +
> > ex.Message,
> > System.Diagnostics.EventLogEntryType.Warning);
> > }
> > }
> > }
> > }
> > catch
> > {
> > }
> > }
> >
> > /// <summary>
> > /// This method sends a command to the server for setting the operator.
> > /// </summary>
> > /// <param name="oper"></param>
> > public void SetOperator(string oper)
> > {
> > if (CommandReceived != null)
> > {
> > try
> > {
> > Composite __params = new Composite();
> > __params.Properties["Operator"] = oper;
> >
> > CommandReceived((int)GICommand.SetOperator,
> > FrameHandler.Serialize(__params));
> > }
> > catch( Exception e )
> > {
> > Logger.Write("Failed to fire server event: " + e.Message +
> > " Stack: " + e.StackTrace);
> > }
> > }
> > }
> >
> >
> > /// <summary>
> > /// This override ensures that if the object is idle for an extended
> > /// period, waiting for messages, it won't lose its lease.
> > /// </summary>
> > public override object InitializeLifetimeService()
> > {
> > return null;
> > }
> >
> > #endregion
> >
> > }
> > }
> >
> >
>
>
>