Closed loongsun closed 6 years ago
@loongsun which commit are you using of mobile-training-todo repo?
your latest commits on Jan 27, 2018.:)
Constructor with the url is URLEndpoint(URI url) in the lib db2.0.0-291, but the constructor is URLEndpoint(uri.getHost(),uri.getPort(), uri.getPath(), secure) in the demo code. Uri scheme is "ws" or"wss" in the lib db2.0.0-291,but scheme is "blip" in the demo code!
@loongsun Thanks again for bug report!
In the CBD lib the scheme is: //--------------------------------------------- // Constant variables //--------------------------------------------- private static final String kURLEndpointScheme = "ws"; private static final String kURLEndpointTLSScheme = "wss"; public URLEndpoint(URI url) { if (url == null) { throw new IllegalArgumentException("The url parameter cannot be null."); }
String scheme = url.getScheme();
if (!(kURLEndpointScheme.equals(scheme) || kURLEndpointTLSScheme.equals(scheme))) {
throw new IllegalArgumentException(
"The url parameter has an unsupported URL scheme (" + scheme + ") " +
"The supported URL schemes are " + kURLEndpointScheme + " and " + kURLEndpointTLSScheme + ".");
}
this.url = url;
}
but in the demo code,the scheme is :: private final static String SYNCGATEWAY_URL = "blip://10.0.2.2:4984/todo/";
that will throw "new IllegalArgumentException"!
@hideki
@loongsun Thank you again!
@hideki hi,hideki: i use the latest demo, the error occurs ::
1-29 15:12:41.216 21051-21111/com.couchbase.todo E/LiteCore [BLIP]: {N8litecore4blip6BLIPIOE#2}==> N8litecore4blip6BLIPIOE ->ws:192.168.2.166:4984/todo/_blipsync
01-29 15:12:41.216 21051-21111/com.couchbase.todo E/LiteCore [BLIP]: {N8litecore4blip6BLIPIOE#2} Caught exception handling incoming BLIP message: BLIP message invalid checksum
01-29 15:12:41.217 21051-21111/com.couchbase.todo E/C4Socket: C4Socket.callback.requestClose() socket -> 0x7bb6a66818, status -> 1006, message -> BLIP message invalid checksum
01-29 15:12:41.217 21051-21111/com.couchbase.todo E/AndroidRuntime: FATAL EXCEPTION: Thread-7
Process: com.couchbase.todo, PID: 21051
java.lang.IllegalArgumentException: Code 1006 is reserved and may not be used.
at okhttp3.internal.ws.WebSocketProtocol.validateCloseCode(WebSocketProtocol.java:120)
at okhttp3.internal.ws.RealWebSocket.close(RealWebSocket.java:401)
at okhttp3.internal.ws.RealWebSocket.close(RealWebSocket.java:397)
at com.couchbase.lite.internal.replicator.CBLWebSocket.requestClose(CBLWebSocket.java:226)
i use the sync-gateway-config.json in the objc :: { "interface":":4984", "log": ["*"], "databases": { "todo": { "server": "walrus:", "users": { "user1": {"password": "pass", "admin_channels": ["user1"]}, "user2": {"password": "pass", "admin_channels": ["user2"]}, "user3": {"password": "pass", "admin_channels": ["user3"]}, "mod": {"password": "pass", "admin_roles": ["moderator"]}, "admin": {"password": "pass", "admin_roles": ["admin"]} }, "roles": { "moderator": {}, "admin": {} }, "unsupported": { "replicator_2":true }, "sync": ` function(doc, oldDoc){'.........
Hi @loongsun, Are you using latest Sync Gateway build? The recent build includes the support of compression with BLIP protocol. You could download Sync Gateway build from the following link. http://latestbuilds.service.couchbase.com/builds/latestbuilds/sync_gateway/2.0.0/ Thanks, Hideki
From SG 2.0.0
You can remove followng lines from configuration file.
"unsupported": {
"replicator_2":true
},
@loongsun FYI: It seems latestbuilds.service.couchbase.com
is down now or it is not accessible from the public network.
@hideki, thanks to you, i wait for some days! it is not accessible from the public network now.
@hideki ,hi hideki, http://latestbuilds.service.couchbase.com/builds/latestbuilds/sync_gateway/2.0.0/ is not down now. can you down one to me?my email is 125736964@qq.com.
@loongsun, The company might intentionally make it not accessible from public IP. Could you please wait for the next SG release? Thanks!
@hideki ,There is no other way, so i only have to wait for it released. By the way,when is the next SG released?when is the couchbase lite db022 released? Thanks!
We planned to release it earlier. But we have been facing delay. Thank you for your patience!
ok, thanks,look forward to your good news!
// ------------------------- // Replicator operation // ------------------------- private void startReplication(String username, String password) { if (!SYNC_ENABLED) return;