상속: OtpLocalNode
예제 #1
0
 public static void Main(string[] args)
 {
     OtpNode pingNode = new OtpNode("ping");
     OtpNode pongNode = new OtpNode("pong");
     bool ok = pingNode.ping("pong", 10000);
     pingNode.close();
     pongNode.close();
     Environment.Exit(ok ? 0 : 1);
 }
예제 #2
0
 public static void Main(string[] args)
 {
     OtpNode a = new OtpNode("a");
     OtpNode b = new OtpNode("b");
     OtpActorMbox echo = (OtpActorMbox)b.createMbox("echo", false);
     b.react(new OtpEchoActor(echo));
     OtpMbox echoback = a.createMbox("echoback", true);
     OtpErlangObject[] v = { echoback.Self, new OtpErlangString("Hello, World!") };
     echoback.send(echo.Self, new OtpErlangTuple(v));
     log.Debug("<- ECHO (back) " + echoback.receive());
     b.close();
     a.close();
 }
예제 #3
0
 public Mailboxes(OtpNode node, OtpActorSched sched)
 {
     this.node = node;
     this.sched = sched;
     byPid = new Dictionary<OtpErlangPid, WeakReference>();
     byName = new Dictionary<String, WeakReference>();
 }
예제 #4
0
            public Acceptor(OtpNode node, int port)
                : base("OtpNode.Acceptor", true)
            {
                this.node = node;

                sock = new TcpListener(new IPEndPoint(IPAddress.Any, port));
                sock.Start();
                this.port = ((IPEndPoint)sock.LocalEndpoint).Port;
                node.port = this.port;
                publishPort();
                base.start();
            }
 /*
  * Accept an incoming connection from a remote node. Used by {@link
  * OtpSelf#accept() OtpSelf.accept()} to create a connection based on data
  * received when handshaking with the peer node, when the remote node is the
  * connection intitiator.
  *
  * @exception java.io.IOException if it was not possible to connect to the
  * peer.
  *
  * @exception OtpAuthException if handshake resulted in an authentication
  * error
  */
 // package scope
 internal OtpCookedConnection(OtpNode self, BufferedTcpClient s)
     : base(self, s)
 {
     this.self = self;
     links = new Links(25);
     start();
 }
 /*
  * Intiate and open a connection to a remote node.
  *
  * @exception java.io.IOException if it was not possible to connect to the
  * peer.
  *
  * @exception OtpAuthException if handshake resulted in an authentication
  * error.
  */
 // package scope
 internal OtpCookedConnection(OtpNode self, OtpPeer other)
     : base(self, other)
 {
     this.self = self;
     links = new Links(25);
     start();
 }
예제 #7
0
 internal OtpActorMbox(OtpActorSched sched, OtpNode home, OtpErlangPid self)
     : base(home, self, null)
 {
     this.sched = sched;
 }
예제 #8
0
 internal OtpActorMbox(OtpActorSched sched, OtpNode home, OtpErlangPid self, String name)
     : base(home, self, name)
 {
     this.sched = sched;
 }
예제 #9
0
 // package constructor: called by OtpNode:createMbox()
 // to create an anonymous
 internal OtpMbox(OtpNode home, OtpErlangPid self)
     : this(home, self, null)
 {
 }
예제 #10
0
 // package constructor: called by OtpNode:createMbox(name)
 // to create a named mbox
 internal OtpMbox(OtpNode home, OtpErlangPid self, String name)
 {
     this.self = self;
     this.home = home;
     this.name = name;
     queue = new GenericQueue();
     links = new Links(10);
 }