Interface SocketFactory


@Deprecated
public interface SocketFactory
Deprecated.
Use SocketFactory instead.
Interface to allow pluggable socket creation in the driver
  • Method Summary

    Modifier and Type Method Description
    java.net.Socket afterHandshake()
    Deprecated.
    Called by the driver after issuing the MySQL protocol handshake and reading the results of the handshake.
    java.net.Socket beforeHandshake()
    Deprecated.
    Called by the driver before issuing the MySQL protocol handshake.
    java.net.Socket connect​(java.lang.String host, int portNumber, java.util.Properties props)
    Deprecated.
    Creates a new socket using the given properties.
  • Method Details

    • afterHandshake

      java.net.Socket afterHandshake() throws java.net.SocketException, java.io.IOException
      Deprecated.
      Called by the driver after issuing the MySQL protocol handshake and reading the results of the handshake.
      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
    • beforeHandshake

      java.net.Socket beforeHandshake() throws java.net.SocketException, java.io.IOException
      Deprecated.
      Called by the driver before issuing the MySQL protocol handshake. Should return the socket instance that should be used during the handshake.
      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
    • connect

      java.net.Socket connect​(java.lang.String host, int portNumber, java.util.Properties props) throws java.net.SocketException, java.io.IOException
      Deprecated.
      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).
      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