Piotr
Piotr

Reputation: 649

How set h2 tcp server to listen on tcp over IPv4?

I create a small app with mixed mode of h2. Database is local and allow remote connections at the same time. Remote connection are by tcp. To start tcp server I use this code:

 public Server h2Server() throws SQLException {
        return Server.createTcpServer("-tcp", "-tcpAllowOthers", "-tcpPort", "9092");
    }

Problem is that app server listen only on tcp6 (IPv6).

How can I change settings that app will listen on tcp (IPv4)?

Upvotes: 0

Views: 315

Answers (1)

gustf
gustf

Reputation: 2017

You can change it by starting java, i.e your app, with -Djava.net.preferIPv4Stack=true

Upvotes: 1

Related Questions