本文整理汇总了C#中Erlang.node方法的典型用法代码示例。如果您正苦于以下问题:C# Erlang.node方法的具体用法?C# Erlang.node怎么用?C# Erlang.node使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Erlang
的用法示例。
在下文中一共展示了Erlang.node方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: exit
// this function used internally when "process" dies
// since Erlang discerns between exit and exit/2.
private void exit(int arity, Erlang.Pid to, System.String reason)
{
try
{
System.String node = to.node();
if (node.Equals(home.node()))
{
home.deliver(new OtpMsg(OtpMsg.exitTag, _self, to, reason));
}
else
{
OtpCookedConnection conn = home.getConnection(node);
if (conn == null)
return ;
switch (arity)
{
case 1:
conn.exit(_self, to, reason);
break;
case 2:
conn.exit2(_self, to, reason);
break;
}
}
}
catch (System.Exception)
{
}
}
示例2: send
/*
* 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)
{
}
}
示例3: unlink
/*
* <p> Remove a link to a remote mailbox or Erlang process. This
* method removes a link created with {@link #link link()}.
* Links are idempotent; calling this method once will remove all
* links between this mailbox and the remote {@link Pid
* pid}. </p>
*
* @param to the {@link Pid pid} representing the object to
* unlink from.
*
**/
public virtual void unlink(Erlang.Pid to)
{
links.removeLink(_self, to);
try
{
System.String node = to.node();
if (node.Equals(home.node()))
{
home.deliver(new OtpMsg(OtpMsg.unlinkTag, _self, to));
}
else
{
OtpCookedConnection conn = home.getConnection(node);
if (conn != null)
conn.unlink(_self, to);
}
}
catch (System.Exception)
{
}
}
示例4: link
/*
* <p> Link to a remote mailbox or Erlang process. Links are
* idempotent, calling this method multiple times will not result in
* more than one link being created. </p>
*
* <p> If the remote process subsequently exits or the mailbox is
* closed, a subsequent attempt to retrieve a message through this
* mailbox will cause an {@link Exit Exit}
* exception to be raised. Similarly, if the sending mailbox is
* closed, the linked mailbox or process will receive an exit
* signal. </p>
*
* <p> If the remote process cannot be reached in order to set the
* link, the exception is raised immediately. </p>
*
* @param to the {@link Pid pid} representing the object to
* link to.
*
* @exception Exit if the {@link Pid pid} referred
* to does not exist or could not be reached.
*
**/
public virtual void link(Erlang.Pid to)
{
try
{
System.String node = to.node();
if (node.Equals(home.node()))
{
if (!home.deliver(new OtpMsg(OtpMsg.linkTag, _self, to)))
{
throw new Erlang.Exit("noproc", to);
}
}
else
{
OtpCookedConnection conn = home.getConnection(node);
if (conn != null)
conn.link(_self, to);
else
throw new Erlang.Exit("noproc", to);
}
}
catch (Erlang.Exit e)
{
throw e;
}
catch (System.Exception)
{
}
links.addLink(_self, to);
}