Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pasindu-jayasundara/check-internet-connection
This project is to develop .jar library to check the internet avaliablity
https://github.com/pasindu-jayasundara/check-internet-connection
Last synced: 28 days ago
JSON representation
This project is to develop .jar library to check the internet avaliablity
- Host: GitHub
- URL: https://github.com/pasindu-jayasundara/check-internet-connection
- Owner: Pasindu-Jayasundara
- Created: 2024-07-04T16:21:41.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-07-06T03:52:22.000Z (7 months ago)
- Last Synced: 2024-07-06T05:20:25.669Z (7 months ago)
- Language: Java
- Size: 47.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Check-Internet-Connection
This project is to develop a .jar library to check the internet availability.#### Features
1) Check Internet Connection Availability (Default, For Specific IP Address)#### Methods
1) >.isAvailable();
2) >.isAvailable(hostName, portNumber);#### How to Use
1) Download the .jar file and add it to your project
2) Import Library:
```java
import com.Internet;
```3) Use Methods:
i) .isAvailable()
> This method can be used to determine whether have the internet connection or not. In default try to establish a connection to the Google server for this.
```java
boolean available = Internet.isAvailable();
```
ii) .isAvailable(hostName, portNumber)
> This method can be used to determine whether have the internet connection or not. Can be used to check with a specific server.
```java
boolean available = Internet.isAvailable(hostName, portNumber);
```#### Outputs:
1) true -> Connection available
2) false -> No Connection#### Example Code:
```java
import com.Internet;
public class Test {
public static void main(String[] args) {
boolean available = Internet.isAvailable(hostName, 0);
boolean available1 = Internet.isAvailable();}
}```