Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GDAX Socket Timeout Exception #1612

Closed
MartinJ-Dev opened this issue Jul 17, 2017 · 3 comments
Closed

GDAX Socket Timeout Exception #1612

MartinJ-Dev opened this issue Jul 17, 2017 · 3 comments

Comments

@MartinJ-Dev
Copy link
Contributor

From time to time, I'd get SocketTimeoutException on GDAX.

java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.net.SocketInputStream.read(SocketInputStream.java:170)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
	at sun.security.ssl.InputRecord.read(InputRecord.java:503)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
	at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:930)
	at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
	at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
	at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:704)
	at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:647)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1535)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1440)
	at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
	at si.mazi.rescu.HttpTemplate.receive(HttpTemplate.java:122)
	at si.mazi.rescu.RestInvocationHandler.receiveAndMap(RestInvocationHandler.java:156)
	at si.mazi.rescu.RestInvocationHandler.invoke(RestInvocationHandler.java:120)
	at com.sun.proxy.$Proxy11.getProductOrderBook(Unknown Source)
	at org.knowm.xchange.gdax.service.GDAXMarketDataServiceRaw.getCoinbaseExProductOrderBook(GDAXMarketDataServiceRaw.java:56)
	at org.knowm.xchange.gdax.service.GDAXMarketDataService.getOrderBook(GDAXMarketDataService.java:50)
@timmolter
Copy link
Member

You could try increasing the timeout that rescu uses. See https://github.com/mmazi/rescu

@MartinJ-Dev
Copy link
Contributor Author

Kindly point out how specifically we can set on this library? The example BitstampTradeServiceRaw on rescu doesn't give examples like

rescu.http.readTimeoutMillis = 5000             # Read timeout in milliseconds when performing HTTP requests. The default is 30000 (30 seconds).
rescu.http.readProxyHost = www.example.com      # HTTP proxy host. Both host and port must be set in order to use a proxy.
rescu.http.readProxyPort = 80                   # HTTP proxy port. Both host and port must be set in order to use a proxy.
rescu.http.ignoreErrorCodes = true              # If set to true, the HTTP response body never be parsed as Exception but always as the method response type. Defaults to false. 

@timmolter
Copy link
Member

Sure thing....

"Rescu can be configured by adding a rescu.properties file in your classpath."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants