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

Support custom SocketFactory which does not support an InetSocketAddress

    Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      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

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

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours
                3h