fix timeout which is in milliseconds, set default to 5000ms

This commit is contained in:
Jörg Prante 2021-08-26 18:48:52 +02:00
parent 7bcc85b223
commit 809792e64e
2 changed files with 11 additions and 7 deletions

View file

@ -1,8 +1,8 @@
group = org.xbib
name = z3950
version = 2.3.2
version = 2.3.3
gradle.wrapper.version = 6.6.1
netty.version = 4.1.65.Final
xbib-cql.version = 3.1.0
netty.version = 4.1.66.Final
xbib-cql.version = 3.1.2
xbib-bibliographic-character-sets.version = 2.0.0

View file

@ -72,7 +72,11 @@ public class JDKZClient implements Client, Closeable {
private OutputStreamBERWriter berWriter;
private JDKZClient(String host, int port, String user, String pass, long timeout,
private JDKZClient(String host,
int port,
String user,
String pass,
long timeout,
String preferredRecordSyntax,
String resultSetName,
String elementSetName,
@ -259,8 +263,8 @@ public class JDKZClient implements Client, Closeable {
try {
lock.lock();
Socket socket = new Socket();
socket.connect(new InetSocketAddress(host, port), (int) timeout);
socket.setSoTimeout((int) timeout * 1000);
socket.connect(new InetSocketAddress(host, port), (int) timeout); // in milliseconds
socket.setSoTimeout((int) timeout); // timeout in milliseconds
this.socket = socket;
InputStream src = new BufferedInputStream(socket.getInputStream());
OutputStream dest = new BufferedOutputStream(socket.getOutputStream());
@ -365,7 +369,7 @@ public class JDKZClient implements Client, Closeable {
private String pass;
private long timeout;
private long timeout = 5000;
private String preferredRecordSyntax = "1.2.840.10003.5.10"; // marc21