Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 665 Bytes

README.md

File metadata and controls

38 lines (25 loc) · 665 Bytes

IPGetter

Get other connectable IP in subnet of HotPost.

Use the SimplePing provided by Apple.

How to use

First step:

add header file.

#import "SGIPGetter.h"
Second step:
[[SGIPGetter shared] sg_getDeviceIP:^(NSArray<NSString *> *ips) {
    NSLog(@"%@", ips);
}];

Configure timeout

Now you can configure the timeout of each ping operation.

[[SGIPGetter shared] configureTimeoutOfEachPing:0.5];

Refresh

This IPGetter will cache the IPs you got automatically, so call the refresh method before you get IPs when network environment has changed.

[[SGIPGetter shared] refresh];