Obsolete
/
ipc.cr-old
Archived
3
0
Fork 0
This repository has been archived on 2024-06-18. You can view files and clone it, but cannot push or open issues/pull-requests.
ipc.cr-old/tests/pongc.cr

24 lines
379 B
Crystal

require "../src/ipc.cr"
client = IPC::Client.new "pong"
server_fd = client.server_fd
if server_fd.nil?
exit 1
end
message = IPC::Message.new server_fd, 1, 42.to_u8, "salut ça va ?"
client.send message
client.loop do |event|
case event
when IPC::Event::MessageReceived
puts "\033[32mthere is a message\033[00m"
puts event.message.to_s
client.close
exit
end
end