fix timeout which is in milliseconds, set default to 5000ms
This commit is contained in:
parent
7bcc85b223
commit
809792e64e
2 changed files with 11 additions and 7 deletions
|
@ -1,8 +1,8 @@
|
||||||
group = org.xbib
|
group = org.xbib
|
||||||
name = z3950
|
name = z3950
|
||||||
version = 2.3.2
|
version = 2.3.3
|
||||||
|
|
||||||
gradle.wrapper.version = 6.6.1
|
gradle.wrapper.version = 6.6.1
|
||||||
netty.version = 4.1.65.Final
|
netty.version = 4.1.66.Final
|
||||||
xbib-cql.version = 3.1.0
|
xbib-cql.version = 3.1.2
|
||||||
xbib-bibliographic-character-sets.version = 2.0.0
|
xbib-bibliographic-character-sets.version = 2.0.0
|
||||||
|
|
|
@ -72,7 +72,11 @@ public class JDKZClient implements Client, Closeable {
|
||||||
|
|
||||||
private OutputStreamBERWriter berWriter;
|
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 preferredRecordSyntax,
|
||||||
String resultSetName,
|
String resultSetName,
|
||||||
String elementSetName,
|
String elementSetName,
|
||||||
|
@ -259,8 +263,8 @@ public class JDKZClient implements Client, Closeable {
|
||||||
try {
|
try {
|
||||||
lock.lock();
|
lock.lock();
|
||||||
Socket socket = new Socket();
|
Socket socket = new Socket();
|
||||||
socket.connect(new InetSocketAddress(host, port), (int) timeout);
|
socket.connect(new InetSocketAddress(host, port), (int) timeout); // in milliseconds
|
||||||
socket.setSoTimeout((int) timeout * 1000);
|
socket.setSoTimeout((int) timeout); // timeout in milliseconds
|
||||||
this.socket = socket;
|
this.socket = socket;
|
||||||
InputStream src = new BufferedInputStream(socket.getInputStream());
|
InputStream src = new BufferedInputStream(socket.getInputStream());
|
||||||
OutputStream dest = new BufferedOutputStream(socket.getOutputStream());
|
OutputStream dest = new BufferedOutputStream(socket.getOutputStream());
|
||||||
|
@ -365,7 +369,7 @@ public class JDKZClient implements Client, Closeable {
|
||||||
|
|
||||||
private String pass;
|
private String pass;
|
||||||
|
|
||||||
private long timeout;
|
private long timeout = 5000;
|
||||||
|
|
||||||
private String preferredRecordSyntax = "1.2.840.10003.5.10"; // marc21
|
private String preferredRecordSyntax = "1.2.840.10003.5.10"; // marc21
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue