public static void SendOwn(Own destination, Own child) { destination.IncreaseSequenceNumber(); var command = new OwnCommand(destination, child); SendCommand(command); }
internal void SendOwn(Own destination, Own obj) { destination.IncSeqnum(); Command cmd = new Command(destination, CommandType.Own, obj); SendCommand(cmd); }
/// <summary> /// Process a termination-request for the given Own obj, /// removing it from the listed of owned things. /// </summary> /// <param name="obj">the Own object to remove and terminate</param> protected override void ProcessTermReq(Own obj) { // When shutting down we can ignore termination requests from owned // objects. The termination request was already sent to the object. if (m_terminating) { return; } // If I/O object is well and alive let's ask it to terminate. // If not found, we assume that termination request was already sent to // the object so we can safely ignore the request. if (!m_owned.Contains(obj)) { return; } m_owned.Remove(obj); RegisterTermAcks(1); // Note that this object is the root of the (partial shutdown) thus, its // value of linger is used, rather than the value stored by the children. SendTerm(obj, m_options.Linger); }
public static void SendPlug(Own destination, bool increaseSequenceNumber = true) { if (increaseSequenceNumber) destination.IncreaseSequenceNumber(); var command = new PlugCommand(destination); SendCommand(command); }
/// <summary> /// Send the Plug command, incrementing the destinations sequence-number if incSeqnum is true. /// </summary> /// <param name="destination">the Own to send the command to</param> /// <param name="incSeqnum">a flag that dictates whether to increment the sequence-number on the destination (optional - defaults to false)</param> protected void SendPlug([NotNull] Own destination, bool incSeqnum = true) { if (incSeqnum) { destination.IncSeqnum(); } SendCommand(new Command(destination, CommandType.Plug)); }
/// <summary> /// Send the Bind command /// </summary> /// <param name="destination"></param> /// <param name="pipe"></param> /// <param name="incSeqnum"></param> protected void SendBind([NotNull] Own destination, [NotNull] Pipe pipe, bool incSeqnum = true) { if (incSeqnum) { destination.IncSeqnum(); } SendCommand(new Command(destination, CommandType.Bind, pipe)); }
internal void SendBind(Own destination, Pipe pipe, bool incSeqnum = true) { if (incSeqnum) { destination.IncSeqnum(); } Command cmd = new Command(destination, CommandType.Bind, pipe); SendCommand(cmd); }
/// <summary> /// Launch the supplied object and become its owner. /// </summary> /// <param name="obj">The object to be launched.</param> protected void LaunchChild([NotNull] Own obj) { // Specify the owner of the object. obj.SetOwner(this); // Plug the object into the I/O thread. SendPlug(obj); // Take ownership of the object. SendOwn(this, obj); }
internal void SendPlug(Own destination, bool incSeqnum = true) { if (incSeqnum) { destination.IncSeqnum(); } Command cmd = new Command(destination, CommandType.Plug); SendCommand(cmd); }
/// <summary> /// Add the given Own object to the list of owned things. /// </summary> /// <param name="obj">the Own object to add to our list</param> /// <remarks> /// If *this* Own is already terminating, then send a request to the given Own obj /// to terminate itself. /// </remarks> protected override void ProcessOwn(Own obj) { // If the object is already being shut down, new owned objects are // immediately asked to terminate. Note that linger is set to zero. if (m_terminating) { RegisterTermAcks(1); SendTerm(obj, 0); return; } // Store the reference to the owned object. m_owned.Add(obj); }
/// <exception cref="NotSupportedException">Not supported on the ZObject class.</exception> protected virtual void ProcessOwn(Own obj) { throw new NotSupportedException(); }
/// <summary> /// Terminate owned object. /// </summary> protected void TermChild(Own obj) { ProcessTermReq(obj); }
/// <summary> /// Process a termination-request command on the Own object. /// </summary> /// <param name="obj"></param> /// <exception cref="NotSupportedException">Not supported on the ZObject class.</exception> protected virtual void ProcessTermReq( Own obj) { throw new NotSupportedException(); }
protected void SendTermAck( Own destination) { SendCommand(new Command(destination, CommandType.TermAck)); }
public OwnCommand(BaseObject destination, Own child) : base(destination) { Child = child; }
/// <summary> /// Set the owner of *this* Own object, to be the given owner. /// </summary> /// <param name="owner">the Own object to be our new owner</param> private void SetOwner([NotNull] Own owner) { Debug.Assert(m_owner == null); m_owner = owner; }
/// <summary> /// Send the Own command, and increment the sequence-number of the destination /// </summary> /// <param name="destination">the Own to send the command to</param> /// <param name="obj">the object to Own</param> protected void SendOwn([NotNull] Own destination, [NotNull] Own obj) { destination.IncSeqnum(); SendCommand(new Command(destination, CommandType.Own, obj)); }
/// <summary> /// Send the Plug command, incrementing the destinations sequence-number if incSeqnum is true. /// </summary> /// <param name="destination">the Own to send the command to</param> /// <param name="incSeqnum">a flag that dictates whether to increment the sequence-number on the destination (optional - defaults to false)</param> protected void SendPlug( Own destination, bool incSeqnum = true) { if (incSeqnum) destination.IncSeqnum(); SendCommand(new Command(destination, CommandType.Plug)); }
internal void SendTermReq(Own destination, Own own) { Command cmd = new Command(destination, CommandType.TermReq, own); SendCommand(cmd); }
internal void SendTerm(Own destination, int linger) { Command cmd = new Command(destination, CommandType.Term, linger); SendCommand(cmd); }
public static void SendCloseRequest(Own destination, Own child) { var command = new CloseRequestCommand(destination, child); SendCommand(command); }
public static void SendCloseAck(Own destination) { var command = new CloseAckCommand(destination); SendCommand(command); }
public static void SendClose(Own destination, TimeSpan linger) { var command = new CloseCommand(destination, linger); SendCommand(command); }
/// <summary> /// Process a termination-request for the given Own obj, /// removing it from the listed of owned things. /// </summary> /// <param name="obj">the Own object to remove and terminate</param> protected override void ProcessTermReq(Own obj) { // When shutting down we can ignore termination requests from owned // objects. The termination request was already sent to the object. if (m_terminating) return; // If I/O object is well and alive let's ask it to terminate. // If not found, we assume that termination request was already sent to // the object so we can safely ignore the request. if (!m_owned.Contains(obj)) return; m_owned.Remove(obj); RegisterTermAcks(1); // Note that this object is the root of the (partial shutdown) thus, its // value of linger is used, rather than the value stored by the children. SendTerm(obj, m_options.Linger); }
/// <summary> /// Terminate owned object. /// </summary> protected void TermChild([NotNull] Own obj) { ProcessTermReq(obj); }
public Endpoint(Own own, Pipe pipe) { Own = own; Pipe = pipe; }
internal void SendTermAck(Own destination) { Command cmd = new Command(destination, CommandType.TermAck); SendCommand(cmd); }
/// <summary> /// For owned objects, asks the owner (<paramref name="destination"/>) to terminate <paramref name="obj"/>. /// </summary> /// <param name="destination"></param> /// <param name="obj"></param> protected void SendTermReq([NotNull] Own destination, [NotNull] Own obj) { SendCommand(new Command(destination, CommandType.TermReq, obj)); }
public CloseRequestCommand(BaseObject destination, Own child) : base(destination) { Child = child; }
/// <summary> /// Terminate owned object. /// </summary> protected void TermChild( Own obj) { ProcessTermReq(obj); }
protected void SendTermAck([NotNull] Own destination) { SendCommand(new Command(destination, CommandType.TermAck)); }
/// <summary> /// Send the Own command, and increment the sequence-number of the destination /// </summary> /// <param name="destination">the Own to send the command to</param> /// <param name="obj">the object to Own</param> protected void SendOwn( Own destination, Own obj) { destination.IncSeqnum(); SendCommand(new Command(destination, CommandType.Own, obj)); }
/// <summary> /// Launch the supplied object and become its owner. /// </summary> /// <param name="obj">The object to be launched.</param> protected void LaunchChild( Own obj) { // Specify the owner of the object. obj.SetOwner(this); // Plug the object into the I/O thread. SendPlug(obj); // Take ownership of the object. SendOwn(this, obj); }
/// <summary> /// Send the Bind command /// </summary> /// <param name="destination"></param> /// <param name="pipe"></param> /// <param name="incSeqnum"></param> protected void SendBind( Own destination, Pipe pipe, bool incSeqnum = true) { if (incSeqnum) destination.IncSeqnum(); SendCommand(new Command(destination, CommandType.Bind, pipe)); }
/// <summary> /// For owned objects, asks the owner (<paramref name="destination"/>) to terminate <paramref name="obj"/>. /// </summary> /// <param name="destination"></param> /// <param name="obj"></param> protected void SendTermReq( Own destination, Own obj) { SendCommand(new Command(destination, CommandType.TermReq, obj)); }
protected void SendTerm([NotNull] Own destination, int linger) { SendCommand(new Command(destination, CommandType.Term, linger)); }
protected void SendTerm( Own destination, int linger) { SendCommand(new Command(destination, CommandType.Term, linger)); }
/// <summary> /// Process a termination-request command on the Own object. /// </summary> /// <param name="obj"></param> /// <exception cref="NotSupportedException">Not supported on the ZObject class.</exception> protected virtual void ProcessTermReq([NotNull] Own obj) { throw new NotSupportedException(); }
/// <summary> /// Take ownership of the given <paramref name="endpoint"/> and register it against the given <paramref name="address"/>. /// </summary> private void AddEndpoint( string address, Own endpoint, Pipe pipe) { // Activate the session. Make it a child of this socket. LaunchChild(endpoint); m_endpoints[address] = new Endpoint(endpoint, pipe); }