aboutsummaryrefslogtreecommitdiff
path: root/shard/lib/net
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2018-09-11 15:39:09 +0200
committerAlex Auvolat <alex@adnab.me>2018-09-11 15:39:09 +0200
commita033c82a3c656a8f53feb60b5b149680771ac247 (patch)
treebc3cb9a6954aebcfd1a0c5f61d367e1083802c3e /shard/lib/net
parente92969db3f0a2093da16eb7db18c9db49225a719 (diff)
downloadshard-a033c82a3c656a8f53feb60b5b149680771ac247.tar.gz
shard-a033c82a3c656a8f53feb60b5b149680771ac247.zip
Use DETS to store shard & peer list to disk
Diffstat (limited to 'shard/lib/net')
-rw-r--r--shard/lib/net/tcpconn.ex4
1 files changed, 4 insertions, 0 deletions
diff --git a/shard/lib/net/tcpconn.ex b/shard/lib/net/tcpconn.ex
index 44669bb..35f7ea5 100644
--- a/shard/lib/net/tcpconn.ex
+++ b/shard/lib/net/tcpconn.ex
@@ -43,6 +43,10 @@ defmodule SNet.TCPConn do
len = byte_size(expected_suffix)
^len = :binary.longest_common_suffix([cli_pkey, expected_suffix])
+ if srv_pkey == cli_pkey do
+ exit :normal
+ end
+
# Connected
:inet.setopts(socket, [active: true])