NamedPipeSocketFactory
Date: 2018-05-06

com.mysql.jdbc

## Class NamedPipeSocketFactory

- java.lang.Object
- - com.mysql.jdbc.NamedPipeSocketFactory

- All Implemented Interfaces:
    SocketFactory, SocketMetadata

      public class NamedPipeSocketFactory
      extends java.lang.Object
      implements SocketFactory, SocketMetadata

  A socket factory for named pipes (on Windows)

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `(package private) class` | `NamedPipeSocketFactory.NamedPipeSocket` A socket that encapsulates named pipes on Windows
    `(package private) class` | `NamedPipeSocketFactory.RandomAccessFileInputStream` Enables OutputStream-type functionality for a RandomAccessFile
    `(package private) class` | `NamedPipeSocketFactory.RandomAccessFileOutputStream` Enables OutputStream-type functionality for a RandomAccessFile

    - ### Nested classes/interfaces inherited from interface com.mysql.jdbc.SocketMetadata

      `SocketMetadata.Helper`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `NAMED_PIPE_PROP_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NamedPipeSocketFactory()` Constructor for NamedPipeSocketFactory.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.net.Socket` | `afterHandshake()` Called by the driver after issuing the MySQL protocol handshake and reading the results of the handshake.
    `java.net.Socket` | `beforeHandshake()` Called by the driver before issuing the MySQL protocol handshake.
    `java.net.Socket` | `connect(java.lang.String host, int portNumber, java.util.Properties props)` Creates a new socket using the given properties.
    `boolean` | `isLocallyConnected(ConnectionImpl conn)`

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

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

- - ### Field Detail

    - #### NAMED_PIPE_PROP_NAME

          public static final java.lang.String NAMED_PIPE_PROP_NAME

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### NamedPipeSocketFactory

          public NamedPipeSocketFactory()

      Constructor for NamedPipeSocketFactory.

  - ### Method Detail

    - #### afterHandshake

          public java.net.Socket afterHandshake()
                                         throws java.net.SocketException,
                                                java.io.IOException

      Description copied from interface: `SocketFactory`
      Called by the driver after issuing the MySQL protocol handshake and reading the results of the handshake.
      Specified by:
        `afterHandshake` in interface `SocketFactory`
      Returns:
        the socket to use after the handshake
      Throws:
        `java.net.SocketException` - if a socket error occurs
        `java.io.IOException` - if an I/O error occurs
      See Also:
        `SocketFactory.afterHandshake()`

    - #### beforeHandshake

          public java.net.Socket beforeHandshake()
                                          throws java.net.SocketException,
                                                 java.io.IOException

      Description copied from interface: `SocketFactory`
      Called by the driver before issuing the MySQL protocol handshake. Should return the socket instance that should be used during the handshake.
      Specified by:
        `beforeHandshake` in interface `SocketFactory`
      Returns:
        the socket to use before the handshake
      Throws:
        `java.net.SocketException` - if a socket error occurs
        `java.io.IOException` - if an I/O error occurs
      See Also:
        `SocketFactory.beforeHandshake()`

    - #### connect

          public java.net.Socket connect(java.lang.String host,
                                int portNumber,
                                java.util.Properties props)
                                  throws java.net.SocketException,
                                         java.io.IOException

      Description copied from interface: `SocketFactory`
      Creates a new socket using the given properties. Properties are parsed by the driver from the URL. All properties other than sensitive ones (user and password) are passed to this method. The driver will instantiate the socket factory with the class name given in the property "socketFactory", where the standard is `com.mysql.jdbc.StandardSocketFactory` Implementing classes are responsible for handling synchronization of this method (if needed).
      Specified by:
        `connect` in interface `SocketFactory`
      Parameters:
        `host` - the hostname passed in the JDBC URL. It will be a single hostname, as the driver parses multi-hosts (for failover) and calls this method for each host connection attempt.
        `portNumber` - the port number to connect to (if required).
        `props` - properties passed to the driver via the URL and/or properties instance.
      Returns:
        a socket connected to the given host
      Throws:
        `java.net.SocketException` - if a socket error occurs
        `java.io.IOException` - if an I/O error occurs
      See Also:
        `com.mysql.jdbc.SocketFactory#connect(String, Properties)`

    - #### isLocallyConnected

          public boolean isLocallyConnected(ConnectionImpl conn)
                                     throws java.sql.SQLException

      Specified by:
        `isLocallyConnected` in interface `SocketMetadata`
      Throws:
        `java.sql.SQLException`