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