Skip to content

Commit

Permalink
Add send_tcp_cp() to send a cluster protocol message over tcp
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Dec 7, 2017
1 parent 01e9dc4 commit 676ca6d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions clusterd
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,17 @@ sub clp_rx_CMD {
return 1;
}

# send_tcp_cp($socket,$cb,$timeout,@args)
#
# send a cluster protocoll message over an async tcp socket.
#
# assume $CLUSTER_PW is valid
#
sub send_tcp_cp {
my ($s,$cb,$timeout,@args)=@_;
my $data=sign($CLUSTER_PW,encode(@args));
My::Select::INET::send_tcp($s,pack('n',length($data)).$data,$timeout,$cb);
}
#----------------------------------------------------------

#our $CLUSTER_PW;
Expand Down

0 comments on commit 676ca6d

Please sign in to comment.