{"action":"created","issue":{"url":"https://api.github.com/repos/socketio/engine.io-client-java/issues/32","labels_url":"https://api.github.com/repos/socketio/engine.io-client-java/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/socketio/engine.io-client-java/issues/32/comments","events_url":"https://api.github.com/repos/socketio/engine.io-client-java/issues/32/events","html_url":"https://github.com/socketio/engine.io-client-java/issues/32","id":105720550,"number":32,"title":"engine.io-client-java 0.6.1 -> 'websocket error' -- SocketTimeoutException","user":{"login":"danpe","id":2140323,"avatar_url":"https://avatars.githubusercontent.com/u/2140323?v=3","gravatar_id":"","url":"https://api.github.com/users/danpe","html_url":"https://github.com/danpe","followers_url":"https://api.github.com/users/danpe/followers","following_url":"https://api.github.com/users/danpe/following{/other_user}","gists_url":"https://api.github.com/users/danpe/gists{/gist_id}","starred_url":"https://api.github.com/users/danpe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danpe/subscriptions","organizations_url":"https://api.github.com/users/danpe/orgs","repos_url":"https://api.github.com/users/danpe/repos","events_url":"https://api.github.com/users/danpe/events{/privacy}","received_events_url":"https://api.github.com/users/danpe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/socketio/engine.io-client-java/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/socketio/engine.io-client-java/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-10T02:28:33Z","updated_at":"2015-10-11T05:33:34Z","closed_at":"2015-10-11T05:33:33Z","body":"Hey,\r\n\r\nSince I updated to `socket.io-client-java 0.6.1` which uses `engine.io-client-java 0.6.1` I keep getting\r\n `'websocket error' -- SocketTimeoutException` \r\nevery few (10-15) seconds after a successful connection.\r\n\r\n```\r\nW/System.err﹕ java.net.SocketTimeoutException\r\n09-08 23:39:36.427  14770-17678/com.myapp.staging W/System.err﹕ at java.net.PlainSocketImpl.read(PlainSocketImpl.java:488)\r\n09-08 23:39:36.427  14770-17678/com.myapp.staging W/System.err﹕ at java.net.PlainSocketImpl.access$000(PlainSocketImpl.java:37)\r\n09-08 23:39:36.427  14770-17678/com.myapp.staging W/System.err﹕ at java.net.PlainSocketImpl$PlainSocketInputStream.read(PlainSocketImpl.java:237)\r\n09-08 23:39:36.427  14770-17678/com.myapp.staging W/System.err﹕ at okio.Okio$2.read(Okio.java:139)\r\n09-08 23:39:36.427  14770-17678/com.myapp.staging W/System.err﹕ at okio.AsyncTimeout$2.read(AsyncTimeout.java:211)\r\n09-08 23:39:36.427  14770-17678/com.myapp.staging W/System.err﹕ at okio.RealBufferedSource.request(RealBufferedSource.java:71)\r\n09-08 23:39:36.427  14770-17678/com.myapp.staging W/System.err﹕ at okio.RealBufferedSource.require(RealBufferedSource.java:64)\r\n09-08 23:39:36.427  14770-17678/com.myapp.staging W/System.err﹕ at okio.RealBufferedSource.readByte(RealBufferedSource.java:77)\r\n09-08 23:39:36.427  14770-17678/com.myapp.staging W/System.err﹕ at com.squareup.okhttp.internal.ws.WebSocketReader.readHeader(WebSocketReader.java:108)\r\n09-08 23:39:36.427  14770-17678/com.myapp.staging W/System.err﹕ at com.squareup.okhttp.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.java:97)\r\n09-08 23:39:36.427  14770-17678/com.myapp.staging W/System.err﹕ at com.squareup.okhttp.internal.ws.RealWebSocket.readMessage(RealWebSocket.java:95)\r\n09-08 23:39:36.427  14770-17678/com.myapp.staging W/System.err﹕ at com.squareup.okhttp.ws.WebSocketCall.createWebSocket(WebSocketCall.java:171)\r\n09-08 23:39:36.434  14770-17678/com.myapp.staging W/System.err﹕ at com.squareup.okhttp.ws.WebSocketCall.access$000(WebSocketCall.java:42)\r\n09-08 23:39:36.434  14770-17678/com.myapp.staging W/System.err﹕ at com.squareup.okhttp.ws.WebSocketCall$1.onResponse(WebSocketCall.java:102)\r\n09-08 23:39:36.434  14770-17678/com.myapp.staging W/System.err﹕ at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:168)\r\n09-08 23:39:36.434  14770-17678/com.myapp.staging W/System.err﹕ at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)\r\n09-08 23:39:36.434  14770-17678/com.myapp.staging W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)\r\n09-08 23:39:36.434  14770-17678/com.myapp.staging W/System.err﹕ at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)\r\n09-08 23:39:36.434  14770-17678/com.myapp.staging W/System.err﹕ at java.lang.Thread.run(Thread.java:818)\r\n```\r\n\r\nThan reconnecting also successful but after few seconds error again.\r\nI'm in a loop of connections and disonnections..\r\n\r\nHere is my server settings:\r\n```javascript\r\n// Start the server\r\nvar app     = express();\r\nvar server = app.listen(port);\r\n\r\nvar io = require('socket.io')(server, {\r\n  'log level': 2,\r\n  'polling duration': 10,\r\n  'close timeout': 12,\r\n  'heartbeat timeout': 30,\r\n  'heartbeat interval': 5,\r\n  'cookie': false\r\n});\r\n```\r\n\r\nI'm having like a singelton socket in my Android App, here is function that creates it:\r\n```Java\r\nprivate Socket createSocket() {\r\n        IO.Options opts = new IO.Options();\r\n        opts.timeout = 10000;\r\n        opts.forceNew = true;\r\n        opts.reconnection = true;\r\n        opts.multiplex = true;\r\n        opts.reconnectionAttempts = Integer.MAX_VALUE;\r\n\r\n        try {\r\n            mSocket = IO.socket(mServerUrl, opts);\r\n            registerEvents();\r\n        } catch (URISyntaxException e) {\r\n            e.printStackTrace();\r\n        }\r\n\r\n        isConnected = false;\r\n\r\n        return mSocket;\r\n}\r\n```\r\nAny ideas?"},"comment":{"url":"https://api.github.com/repos/socketio/engine.io-client-java/issues/comments/147160057","html_url":"https://github.com/socketio/engine.io-client-java/issues/32#issuecomment-147160057","issue_url":"https://api.github.com/repos/socketio/engine.io-client-java/issues/32","id":147160057,"user":{"login":"nkzawa","id":775227,"avatar_url":"https://avatars.githubusercontent.com/u/775227?v=3","gravatar_id":"","url":"https://api.github.com/users/nkzawa","html_url":"https://github.com/nkzawa","followers_url":"https://api.github.com/users/nkzawa/followers","following_url":"https://api.github.com/users/nkzawa/following{/other_user}","gists_url":"https://api.github.com/users/nkzawa/gists{/gist_id}","starred_url":"https://api.github.com/users/nkzawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkzawa/subscriptions","organizations_url":"https://api.github.com/users/nkzawa/orgs","repos_url":"https://api.github.com/users/nkzawa/repos","events_url":"https://api.github.com/users/nkzawa/events{/privacy}","received_events_url":"https://api.github.com/users/nkzawa/received_events","type":"User","site_admin":false},"created_at":"2015-10-11T05:33:33Z","updated_at":"2015-10-11T05:33:33Z","body":"0.6.2 is out."}}