Inheritance: OtpLocalNode
コード例 #1
0
ファイル: ping.cs プロジェクト: K2InformaticsGmbH/erlnet
 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
ファイル: echo.cs プロジェクト: K2InformaticsGmbH/erlnet
 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
ファイル: OtpNode.cs プロジェクト: K2InformaticsGmbH/erlnet
 public Mailboxes(OtpNode node, OtpActorSched sched)
 {
     this.node = node;
     this.sched = sched;
     byPid = new Dictionary<OtpErlangPid, WeakReference>();
     byName = new Dictionary<String, WeakReference>();
 }
コード例 #4
0
ファイル: OtpNode.cs プロジェクト: K2InformaticsGmbH/erlnet
            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();
            }
コード例 #5
0
 /*
  * 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();
 }
コード例 #6
0
 /*
  * 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
ファイル: OtpMbox.cs プロジェクト: K2InformaticsGmbH/erlnet
 // package constructor: called by OtpNode:createMbox()
 // to create an anonymous
 internal OtpMbox(OtpNode home, OtpErlangPid self)
     : this(home, self, null)
 {
 }
コード例 #10
0
ファイル: OtpMbox.cs プロジェクト: K2InformaticsGmbH/erlnet
 // 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);
 }