pongc now exits correctly.
parent
725b23e4e5
commit
c7c0909f35
|
@ -58,6 +58,8 @@ def main
|
|||
exit 1
|
||||
end
|
||||
|
||||
nb_messages_remaining = CLI.rounds
|
||||
|
||||
# Listening on STDIN.
|
||||
client << 0
|
||||
|
||||
|
@ -87,7 +89,11 @@ def main
|
|||
client.send message
|
||||
end
|
||||
when IPC::Event::MessageReceived
|
||||
info "new message from #{event.fd}: #{event.message.to_s}"
|
||||
nb_messages_remaining -= 1
|
||||
info "new message from #{event.fd}: #{event.message.to_s}, remaining #{nb_messages_remaining}"
|
||||
if nb_messages_remaining == 0
|
||||
exit 0
|
||||
end
|
||||
when IPC::Event::Disconnection
|
||||
info "Disconnection from #{event.fd}"
|
||||
if event.fd == 0
|
||||
|
|
Reference in New Issue