public void Pong(int ticks) { Console.WriteLine("Pong: Ticks = " + ticks); if (ticks != 0) { //Retrieve the Callback Channel (in this case the Channel that was used to send the //original message) and make an outgoing call until ticks reaches 0. IPingPong channel = OperationContext.Current.GetCallbackChannel <IPingPong>(); channel.Ping((ticks - 1)); } }
public void FazPingPong(IPingPong pp) { if (pp.EstPing) { Console.WriteLine("vai fazer Ping"); pp.Ping(pp); //pp.Ping(); } else { Console.WriteLine("vai fazer Pong"); pp.Pong(); } pp.EstPing=!pp.EstPing; }
public void Ping(IPingPong myself) { Console.WriteLine("PING"+myself.EstPing); }