Network Diagnosis for iOS

Overview

Network Diagnosis for iOS

@qiniu on weibo Software License Build Status Latest Stable Version Platform

中文

Summary

Network Diagnosis Library,support Ping/TcpPing/Rtmp/TraceRoute/DNS/external IP/external DNS。

Install

CocoaPods

pod "QNNetDiag"

Usage

Ping

@interface YourLogger : NSObject <QNNOutputDelegate>
...
@end

[QNNPing start:@"www.google.com" output:[[YourLogger alloc] init] complete:^(QNNPingResult* r) {
        ...
}];

TcpPing

[QNNTcpPing start:@"www.baidu.com" output:[[QNNTestLogger alloc] init] complete:^(QNNTcpPingResult* r) {
    ...
}];

Test

All Unit Test

$ xctool -workspace NetDiag.xcworkspace -scheme NetDiagTests build test -sdk iphonesimulator

Faq

  • If there are any compile errors, please look at Cocoapods's troubleshooting

Contributing

Please Look atContributing Guide

Contributors

Contact us

  • If you find any bug, please submit issue
  • If you need any feature, please submit issue
  • If you want to contribute, please submit pull request

License

The MIT License (MIT). License.

Comments
  • Compilation errors on Xcode 9.0 beta 3

    Compilation errors on Xcode 9.0 beta 3

    Using the newly released Xcode 9 beta 3, and the 'QNNetDiag' cocoapod, it fails to compile due to errors with macros. CocoaLumberjack has had to deal with a compile issue from this new Xcode beta as well.

    screen shot 2017-07-21 at 3 22 35 pm

    opened by kbmeister 4
  • QNNPing写的是ping还是tcp ping ?

    QNNPing写的是ping还是tcp ping ?

    为什么在QNNPing里面制定了端口30002 ? ping不是ip层的吗?发送icmp包,你这里写30002是什么意思?

    - (void)run {
        const char *hostaddr = [_host UTF8String];
        if (hostaddr == NULL) {
            hostaddr = "\0";
        }
    
        NSDate *begin = [NSDate date];
        struct sockaddr_in addr;
        memset(&addr, 0, sizeof(addr));
        addr.sin_len = sizeof(addr);
        addr.sin_family = AF_INET;
        addr.sin_port = htons(30002);
        addr.sin_addr.s_addr = inet_addr(hostaddr);
    
    opened by MaxwellQi 0
  • Optimize code

    Optimize code

    1. The callback block parameter is better to be putted on the last
    2. Continue the ping progress even timeout occurs
    3. Change the type of interval, and use it instead of hardcode 0.1 second
    4. Add self-> when access ivar in the block to make compiler happy
    opened by XueshiQiao 0
  • Crashed on returning app from lock screen

    Crashed on returning app from lock screen

    Name | Value ------------ | ------------- Xcode | 10.1 (10B61) Swift | 4.2 iOS | 12.1 (16B92) Bitcode | false

    Steps to reproduce:

    1. Open the app
    2. Use QNNTraceRoute to trace domain
    3. Lock screen by pressing power button directly (while traceroute is still ongoing)
    4. Unlock lock screen (wether by passcode or touch id or face id)
    5. App crashed and return to spring board

    2019-01-25 12:51:30.747934+0800 app[1971:480449] errro Unknown error: -1

    opened by vv92717230 0
  • Pinging ports timed out

    Pinging ports timed out

    Hi,

    I'm working on a small app that will ping Apple's ports from https://support.apple.com/en-vn/HT202944.

    When I try

    [QNNTcpPing start:@"www.apple.com" port:2195 count:3 output:nil complete: ^(QNNTcpPingResult *r) {
        NSLog(@"%@", r);
      }];
    

    I get timeout error=60. And if I try port 80, I get response error=0.

    I've tried also "http://www.apple.com" and got "tcp connect failed -1006"

    Any help would be great.

    Thanks!

    opened by babac87 0
  • #0 Crashed: qnn_que_serial EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000

    #0 Crashed: qnn_que_serial EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000

    #28. Crashed: qnn_que_serial 0 libsystem_c.dylib 0x1be57d24 _inet_aton_check + 11 1 libsystem_c.dylib 0x1be7f891 inet_addr + 14 2 libsystem_c.dylib 0x1be7f891 inet_addr + 14 3 QNNetDiag 0x22d8f2f -[QNNPing run] (QNNPing.m:321) 4 libdispatch.dylib 0x1bdfd797 _dispatch_call_block_and_release + 10 5 libdispatch.dylib 0x1be0a59d _dispatch_queue_serial_drain + 854 6 libdispatch.dylib 0x1be00b71 _dispatch_queue_invoke + 886 7 libdispatch.dylib 0x1be0aa1f _dispatch_queue_override_invoke + 282 8 libdispatch.dylib 0x1be0c1b5 _dispatch_root_queue_drain + 326 9 libdispatch.dylib 0x1be0c00f _dispatch_worker_thread3 + 106 10 libsystem_pthread.dylib 0x1bfb287d _pthread_wqthread + 1040 11 libsystem_pthread.dylib 0x1bfb245c start_wqthread + 8

    opened by gordon-SU 0
Releases(v0.0.7)
Owner
Qiniu Cloud
Connect Data, Redefine Value.
Qiniu Cloud
Another network wrapper for URLSession. Built to be simple, small and easy to create tests at the network layer of your application.

Another network wrapper for URLSession. Built to be simple, small and easy to create tests at the network layer of your application. Install Carthage

Ronan Rodrigo Nunes 89 Dec 26, 2022
A network extension app to block a user input URI. Meant as a network extension filter proof of concept.

URIBlockNE A network extension app to block a user input URI. Meant as a network extension filter proof of concept. This is just a research effort to

Charles Edge 5 Oct 17, 2022
Say goodbye to the Fat ugly singleton Network Manager with this Network Layer

MHNetwork Protocol Oriented Network Layer Aim to avoid having bloated singleton NetworkManager Philosophy the main philosophy behind MHNetwork is to h

Mohamed Emad Hegab 19 Nov 19, 2022
Easy and lightweight network layer for creating different set of network requests like GET, POST, PUT, DELETE customizable with coders conforming to TopLevelDecoder, TopLevelEncoder

Easy and lightweight network layer for creating different set of network requests like GET, POST, PUT, DELETE customizable with coders conforming to TopLevelDecoder, TopLevelEncoder

Igor 2 Sep 16, 2022
A lightweight, one line setup, iOS / OSX network debugging library! 🦊

Netfox provides a quick look on all executed network requests performed by your iOS or OSX app. It grabs all requests - of course yours, requests from

Christos Kasketis 3.4k Dec 28, 2022
iOS network debugging, like a wizard 🧙‍♂️

Start debugging iOS network calls like a wizard, without extra code! Wormholy makes debugging quick and reliable. What you can do: No code to write an

Paolo Musolino 2.1k Jan 8, 2023
iOS Network monitor/interceptor framework written in Swift

NetShears NetShears is a Network interceptor framework written in Swift. NetShears adds a Request interceptor mechanisms to be able to modify the HTTP

Divar 119 Dec 21, 2022
An iOS LAN Network Scanner library

MMLanScan MMLanScan is an open source project for iOS that helps you scan your network and shows the available devices and their MAC Address, hostname

Michael Mavris 459 Dec 11, 2022
An iOS app for communicating with your clightning node over the lightning network

An iOS app for communicating with your clightning node over the lightning network

William Casarin 18 Dec 14, 2022
iOS 15, MVVM, Async Await, Core Data, Abstract Network Layer, Repository & DAO design patterns, SwiftUI and Combine

iOS 15, MVVM, Async Await, Core Data, Abstract Network Layer, Repository & DAO design patterns, SwiftUI and Combine

Conrado Mateu Gisbert 18 Dec 23, 2022
Dratini is a neat network abstraction layer.

Dratini Dratini is a neat network abstraction layer. If you are looking for a solution to make your network layer neat, Dratini is your choice. Dratin

Kevin Lin 37 Jan 29, 2022
Network abstraction layer written in Swift.

Moya 14.0.0 A Chinese version of this document can be found here. You're a smart developer. You probably use Alamofire to abstract away access to URLS

Moya 14.4k Jan 1, 2023
A toolkit for Network Extension Framework

NEKit NEKit is deprecated. It should still work but I'm not intent on maintaining it anymore. It has many flaws and needs a revamp to be a high-qualit

zhuhaow 2.8k Jan 2, 2023
Elegant network abstraction layer in Swift.

Elegant network abstraction layer in Swift. 中文 Design Features Requirements Communication Installation Usage Base Usage - Target - Request - Download

null 100 Dec 9, 2022
Lightweight network abstraction layer, written on top of Alamofire

TRON is a lightweight network abstraction layer, built on top of Alamofire. It can be used to dramatically simplify interacting with RESTful JSON web-

MLSDev 528 Dec 26, 2022
A generic network layer written in swift

SwiftyNet 1.0.0 A generic network layer written in swift. you can use it as an abstraction layer above Alamofire with generic returned types. Installa

Mohamed Salah Zidane 17 Oct 11, 2021
Swift Paging is a framework that helps you load and display pages of data from a larger dataset from local storage or over network.

Swift Paging is a framework that helps you load and display pages of data from a larger dataset from local storage or over network. This approach allows your app to use both network bandwidth and system resources more efficiently. It's built on top of Combine, allowing you to harness its full power, handle errors easily, etc.

Gordan Glavaš 12 Dec 9, 2022
Automatically sets the network activity indicator for any performed request.

BigBrother BIG BROTHER IS WATCHING YOU. BigBrother is a Swift library made for iOS that automatically watches for any performed request and sets the n

Marcelo Fabri 446 Dec 17, 2022
Generic Network Layer created using Swift.

Generic-Network-Layer_iOS Generic Network Layer created using URLSession. Networking is an essential element in app development, and you'll need API c

Shubham Kr. Singh 41 Dec 31, 2022