FinlayDaG33k
Posts: 14
Joined: Mon Feb 22, 2016 5:56 pm

Ping a server, return true or false

Mon Feb 22, 2016 6:05 pm

How can I make it that my Pi pings a server + port, , sees if it's online and returns true or false accordingly???
Please provide me with code rather than just saying what I should do as I am just starting out

jordanmills
Posts: 3
Joined: Wed Aug 26, 2015 3:11 pm

Re: Ping a server, return true or false

Thu Feb 25, 2016 10:41 pm

Powershell:

Test-Connection -ComputerName [host.domain.ext] -Count 1 -Quiet

asandford
Posts: 1998
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: Ping a server, return true or false

Fri Feb 26, 2016 1:26 am

FinlayDaG33k wrote:How can I make it that my Pi pings a server + port, , sees if it's online and returns true or false accordingly???
You can't ping ports, as Ping uses ICMP which doesn't have the notion of ports which are implemented in transport layer protocols like TCP and UDP
FinlayDaG33k wrote:Please provide me with code rather than just saying what I should do as I am just starting out
Give a man a fish and you feed him for a day; teach a man to fish and you feed him for a lifetime

Return to “Windows 10 for IoT”