Java 类com.squareup.okhttp.ws.WebSocketListener 实例源码

项目:appstax-java    文件:AxClient.java   
protected void socket(String path, WebSocketListener listener) {
    Request.Builder req = new Request.Builder();
    setWsPath(req, path);
    setKeys(req);
    setBody(req, Method.GET, null);
    WebSocketCall.create(ok, req.build()).enqueue(listener);
}
项目:appstax-java    文件:AxChannelTest.java   
private void socket(WebSocketListener listener) throws IOException {
    server.enqueue(new MockResponse().setBody(getResource("user-session-success.json")));
    server.enqueue(new MockResponse().withWebSocketUpgrade(listener));
}