MCPcopy Create free account
hub / github.com/BaseXdb/basex / connect

Method connect

basex-api/src/test/java/org/basex/http/ws/WsTest.java:69–74  ·  view source on GitHub ↗

Opens a WebSocket connection to the test server. @param path WebSocket path (must start with "/") @param listener listener @return JDK WebSocket client @throws Exception exception

(final String path, final Listener listener)

Source from the content-addressed store, hash-verified

67 * @throws Exception exception
68 */
69 protected static java.net.http.WebSocket connect(final String path, final Listener listener)
70 throws Exception {
71 final HttpClient client = HttpClient.newHttpClient();
72 return client.newWebSocketBuilder().connectTimeout(Duration.ofSeconds(10)).
73 buildAsync(URI.create(WS_ROOT + path), listener).get(10, TimeUnit.SECONDS);
74 }
75
76 /**
77 * Closes a WebSocket and waits for the close handshake to complete.

Callers 10

standardHeadersMethod · 0.45
defaultValueMethod · 0.45
subProtocolsEmptyMethod · 0.45
idAndIdsMethod · 0.45
emitMethod · 0.45
broadcastMethod · 0.45
sendMethod · 0.45
setGetDeleteMethod · 0.45
unknownIdErrorMethod · 0.45
__init__Method · 0.45

Calls 2

getMethod · 0.65
createMethod · 0.45

Tested by

no test coverage detected