Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-37

Support custom SocketFactory which does not support an InetSocketAddress

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 1.1.2
    • None
    • None
    • None
    • Linux, JDK 1.7

    Description

      Its possible to use a custom SocketFactory. To use unix Sockets theres exist a project called junixsocket here:

      http://code.google.com/p/junixsocket/

      I've writte a custom SocketFactory which does create unix sockets - but the code does force the connect to an

      InetSocketAddress sockAddr = new InetSocketAddress(host, port);

      in connect of MySQLProtocol class - which are of cause not supported and denied by the AFUnixSocket implementation.

      I've patched the Protocol class to read like this:

             String unixSocket = info.getProperty("unixsocket");
              if (unixSocket == null) {
                if (connectTimeout != null) {
                  socket.connect(sockAddr, connectTimeout * 1000);
                } else {
                  socket.connect(sockAddr);
                }    
              }

      and did specify the property unixsocket - value does not matter - to the properties given to the Driver class.
      After that i was able to use AF_UNIX Sockets.

      Would be nice if its possible to get some patch or property switch like this one, to make use of them.
      Or maybe use a custom SocketFactory interfae like connector/J does.

      Attachments

        Activity

          People

            wlad Vladislav Vaintroub
            tkrah Torsten Krah
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.