Skip to content

satomixx/EasyPing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasyPing

EasyPing

Sample

  • ViewController.swift
import UIKit

class ViewController: UIViewController, PingDelegate {

    var isFinish = false
    var results = [Dictionary<String, Any>]()
    var max = 30 // max hop
    
    let url = "www.google.com"
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let queue = dispatch_queue_create("myQueue", DISPATCH_QUEUE_CONCURRENT)
        
        let ping = Ping()
        ping.delegate = self

        for i in 0 ... max {
            dispatch_async(queue, {
                ping.send(self.url, id: i, ttl: UInt32(i+1), max: self.max)
            })
        }
  }

Releases

No releases published

Packages

No packages published