Package com.castlabs.android.network

# Class SocketConnectivityCheck

java.lang.Object
com.castlabs.android.network.SocketConnectivityCheck

All Implemented Interfaces:
  `ConnectivityCheck`

Direct Known Subclasses:
  `GoogleDNSConnectivityCheck`

public class SocketConnectivityCheck extends Object implements ConnectivityCheck

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SocketConnectivityCheck(Context context, String lookupHost, int port, int timeoutMs)`
  Check the connectivity by establishing a connection to lookupHost:port with connection timeoutMs

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `isConnected()`
  Returns true if an internet connection is available

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### SocketConnectivityCheck

    public SocketConnectivityCheck(@NonNull Context context, @NonNull String lookupHost, int port, int timeoutMs)
    Check the connectivity by establishing a connection to lookupHost:port with connection timeoutMs
    Parameters:
      `context` - The context
      `lookupHost` - Hostname or IP address. IP address is preferable as it will not raise any potential timing/unpredicted DNS resolution issues
      `port` - The port
      `timeoutMs` - The connection timeout in ms

- ## Method Details

  - ### isConnected

    public boolean isConnected()
    Description copied from interface: `ConnectivityCheck`
    Returns true if an internet connection is available
    Specified by:
      `isConnected` in interface `ConnectivityCheck`
    Returns:
      True if an internet connection is available