blockgiven / takumi-server_list_ping

minecraft server list ping packet and tools.
https://rubygems.org/gems/takumi-server_list_ping
MIT License
1 stars 0 forks source link

Ping is kinda slow #1

Open Cysioland opened 9 years ago

Cysioland commented 9 years ago

Script, that just pings the server, and, if nothing fails just spits out the output of your library, runs just kinda slow.

Script code:

#!/usr/bin/env ruby
require 'pushbullet'
require 'takumi/server_list_ping'

begin
  puts Takumi::ServerListPing.ping("[cut]", 25565)
  puts "Serwer trybi"
rescue
  Pushbullet.set_access_token '[cut]'
  Pushbullet::V2::Push.note 'Awaria BluCraft', $!

  puts 'Wiadomość wysłana'
end

time ./scriptname.rb: 0.25user 0.11system 0:30.44elapsed 1%CPU (0avgtext+0avgdata 14676maxresident)k

blockgiven commented 9 years ago

try timeout option

Takumi::ServerListPing.ping("[cut]", 25565, timeout: 10)