TEAM LICENSES: Save money and learn new skills through a Hacking with Swift+ team license >>

how to ping an IP address

Forums > Swift

I am looking for a simple way to ping an IP address in Swift.. I cant seem to locate a Class or Library that has this?

I have seen how to get data from URL's and websites, etc, but not a basic ICMP ping request...

2      

Apple published a detailed example written in Objective-C called SimplePing: https://developer.apple.com/library/archive/samplecode/SimplePing/Introduction/Intro.html

A few people have posted Swift wrappers for Apple's code. Here's one: https://github.com/robertmryan/SimplePing

In the ReadMe for the latter, the initial text is for the Swift code, and the remaining text under the heading "About" is a verbatim quote from Apple's ObjC example.

However, I don’t know whether the Foundation classes used in the ObjC code have been removed.

3      

Hacking with Swift is sponsored by Blaze.

SPONSORED Still waiting on your CI build? Speed it up ~3x with Blaze - change one line, pay less, keep your existing GitHub workflows. First 25 HWS readers to use code HACKING at checkout get 50% off the first year. Try it now for free!

Reserve your spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Archived topic

This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.