Example #1
0
 /*
 * Send a message to a named mailbox created from the same node as
 * this mailbox.
 *
 * @param name the registered name of recipient mailbox.
 *
 * @param msg the body of the message to send.
 *
 **/
 public virtual void send(System.String name, Erlang.Object msg)
 {
     home.deliver(new OtpMsg(_self, name, (Erlang.Object) (msg.clone())));
 }
Example #2
0
 /*
 * Send a message to a remote {@link Pid pid}, representing
 * either another {@link OtpMbox mailbox} or an Erlang process.
 *
 * @param to the {@link Pid pid} identifying the intended
 * recipient of the message.
 *
 * @param msg the body of the message to send.
 *
 **/
 public virtual void send(Erlang.Pid to, Erlang.Object msg)
 {
     try
     {
         System.String node = to.node();
         if (node.Equals(home.node()))
         {
             home.deliver(new OtpMsg(to, (Erlang.Object) (msg.clone())));
         }
         else
         {
             OtpCookedConnection conn = home.getConnection(node);
             if (conn == null)
                 return ;
             conn.send(_self, to, msg);
         }
     }
     catch (System.Exception)
     {
     }
 }