franktank / raft

Using raft consensus algorithm in iOS application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add string in data as delimiter

franktank opened this issue · comments

Parsing messages between

  • AppendEntries RPC Request / Response

  • RequestVote RPC Request / Response

  • Heartbeat / AppendEntries Request / RequestVote Request -> Multicast

  • AppendEntries / RequestVote Response -> Unicast to leader, leader receives one at a time

aereq / aeresp

rvreq / rvresp

Stronger solution: JSON?

JSON -> String -> Data

{
"type" : "appendEntriesResponse OR appendEntriesRequest OR requestVoteRequest OR requestVoteResponse"
"message" : "Some message"
}