summaryrefslogtreecommitdiff
path: root/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java
diff options
context:
space:
mode:
Diffstat (limited to 'lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java')
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java45
1 files changed, 23 insertions, 22 deletions
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java
index 011709beab..70ecc5b695 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpCookedConnection.java
@@ -122,9 +122,7 @@ public class OtpCookedConnection extends AbstractConnection {
switch (msg.type()) {
case OtpMsg.linkTag:
- if (delivered) {
- links.addLink(msg.getRecipientPid(), msg.getSenderPid());
- } else {
+ if (!delivered) {
try {
// no such pid - send exit to sender
super.sendExit(msg.getRecipientPid(), msg.getSenderPid(),
@@ -133,13 +131,7 @@ public class OtpCookedConnection extends AbstractConnection {
}
}
break;
-
- case OtpMsg.unlinkTag:
- case OtpMsg.exitTag:
- links.removeLink(msg.getRecipientPid(), msg.getSenderPid());
- break;
-
- case OtpMsg.exit2Tag:
+ default:
break;
}
@@ -200,30 +192,39 @@ public class OtpCookedConnection extends AbstractConnection {
}
}
- /*
- * snoop for outgoing links and update own table
- */
- synchronized void link(final OtpErlangPid from, final OtpErlangPid to)
- throws OtpErlangExit {
+ void link(final OtpErlangPid from, final OtpErlangPid to)
+ throws OtpErlangExit {
try {
super.sendLink(from, to);
- links.addLink(from, to);
} catch (final IOException e) {
throw new OtpErlangExit("noproc", to);
}
}
- /*
- * snoop for outgoing unlinks and update own table
- */
- synchronized void unlink(final OtpErlangPid from, final OtpErlangPid to) {
- links.removeLink(from, to);
+ void unlink(final OtpErlangPid from, final OtpErlangPid to, final long unlink_id) {
+ try {
+ super.sendUnlink(from, to , unlink_id);
+ } catch (final IOException e) {
+ }
+ }
+
+ void unlink_ack(final OtpErlangPid from, final OtpErlangPid to, final long unlink_id) {
try {
- super.sendUnlink(from, to);
+ super.sendUnlinkAck(from, to , unlink_id);
} catch (final IOException e) {
}
}
+ synchronized void node_link(OtpErlangPid local, OtpErlangPid remote, boolean add)
+ {
+ if (add) {
+ links.addLink(local, remote, true);
+ }
+ else {
+ links.removeLink(local, remote);
+ }
+ }
+
/*
* When the connection fails - send exit to all local pids with links
* through this connection