mirror of
https://github.com/status-im/nim-raft.git
synced 2025-01-17 00:31:11 +00:00
fix
This commit is contained in:
parent
1f683dd2a7
commit
491b9129f6
@ -37,18 +37,20 @@ proc TestRaftMessageSendCallbackCreate(): RaftMessageSendCallback =
|
|||||||
host = c.host
|
host = c.host
|
||||||
port = c.port
|
port = c.port
|
||||||
var
|
var
|
||||||
client = newAsyncHttpClient()
|
client = newHttpClient()
|
||||||
s = MsgStream.init() # besides MsgStream, you can also use Nim StringStream or FileStream
|
s = MsgStream.init() # besides MsgStream, you can also use Nim StringStream or FileStream
|
||||||
|
|
||||||
s.pack(msg) #here the magic happened
|
s.pack(msg) #here the magic happened
|
||||||
|
|
||||||
var
|
var
|
||||||
resp = await client.post(fmt"http://host:port", s.data)
|
resp = client.post(fmt"http://{host}:{port}", s.data)
|
||||||
|
|
||||||
echo resp.status
|
echo resp.status
|
||||||
|
|
||||||
var
|
var
|
||||||
ss = MsgStream.init(resp.body)
|
ss = MsgStream.init(resp.body)
|
||||||
xx: RaftMessageResponseBase
|
xx: RaftMessageResponseBase
|
||||||
|
|
||||||
ss.unpack(xx) #and here too
|
ss.unpack(xx) #and here too
|
||||||
result = xx
|
result = xx
|
||||||
|
|
||||||
|
@ -48,6 +48,8 @@ async def main():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
|
readFIFO = readFIFO + sys.argv[1]
|
||||||
|
writeFIFO = writeFIFO + sys.argv[1]
|
||||||
os.mkfifo(readFIFO)
|
os.mkfifo(readFIFO)
|
||||||
os.mkfifo(writeFIFO)
|
os.mkfifo(writeFIFO)
|
||||||
except OSError as oe:
|
except OSError as oe:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user