나는 핑 (또는 다른 아주 제한 등 시스템 프로세스없이 최장) 죽일 수있는 방법 - 루비 스레드에서 (핑은 그냥 간단한 예제) :킬 시스템 프로세스
a = Thread.new do
system 'ping localhost'
end
a.kill
a.exit
a.terminate
while true
sleep 5
p a.alive?
end
출력 : =>
을PING localhost.localdomain (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost.localdomain (127.0.0.1): icmp_req=1 ttl=64 time=0.023 ms
....
true
64 bytes from localhost.localdomain (127.0.0.1): icmp_req=7 ttl=64 time=0.022 ms
.....
true
......
그래서 스레드와 핑 프로세스를 중지해야하지만 어떻게 해야할지 모르겠다.
당신은 GEM [하나님] (http://godrb.com/) –