com.sun.mail.util

## Class SocketConnectException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.io.IOException
      - - com.sun.mail.util.SocketConnectException

- All Implemented Interfaces:
    Serializable

      public class SocketConnectException
      extends IOException

  An IOException that indicates a socket connection attempt failed. Unlike java.net.ConnectException, it includes details of what we were trying to connect to.
  Since:
    JavaMail 1.5.0
  Author:
    Bill Shannon
  See Also:
    `ConnectException`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SocketConnectException(String msg, Exception cause, String host, int port, int cto)` Constructs a SocketConnectException.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getConnectionTimeout()` The timeout used for the connection attempt.
    `Exception` | `getException()` The exception that caused the failure.
    `String` | `getHost()` The host we were trying to connect to.
    `int` | `getPort()` The port we were trying to connect to.

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### SocketConnectException

          public SocketConnectException(String msg,
                                Exception cause,
                                String host,
                                int port,
                                int cto)

      Constructs a SocketConnectException.
      Parameters:
        `msg` - error message detail
        `cause` - the underlying exception that indicates the failure
        `host` - the host we were trying to connect to
        `port` - the port we were trying to connect to
        `cto` - the timeout for the connection attempt

  - ### Method Detail

    - #### getException

          public Exception getException()

      The exception that caused the failure.
      Returns:
        the exception

    - #### getHost

          public String getHost()

      The host we were trying to connect to.
      Returns:
        the host

    - #### getPort

          public int getPort()

      The port we were trying to connect to.
      Returns:
        the port

    - #### getConnectionTimeout

          public int getConnectionTimeout()

      The timeout used for the connection attempt.
      Returns:
        the connection timeout

Copyright © 2016 Oracle. All rights reserved.