We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
initLHTTP() { this.lHttpClient = new Lhttp("ws://127.0.0.1:9527"); console.log(this.lHttpClient); }, lHTTPOnOpen() { if (this.visible === true) { this.lHttpClient.on_open = function(context) { context.subscribe("test", "", null, ""); }; } else { this.lHttpClient.conn.close(); } }, lHTTPOnMessage() { this.lHttpClient.on_message = function(context) { if (context.getBody() !== "") { const lhttpData = JSON.parse(context.getBody().split("\r\n")[0]); console.log(lhttpData); } }; }, lHTTPOnError() { this.lHttpClient.on_error = function() { this.initLHTTP(); }; }, lHTTPOnClose() { this.lHttpClient.on_close = function(context) { console.log("onclose:" + this.lHttpClient.conn + context); this.lHttpClient.conn.close(); }; },
这样写lHTTPOnClose不生效,我只能把close写到
lHTTPOnOpen() { if (this.visible === true) { this.lHttpClient.on_open = function(context) { context.subscribe("test", "", null, ""); }; } else { this.lHttpClient.conn.close(); } },
The text was updated successfully, but these errors were encountered:
No branches or pull requests
如何关闭socket
这样写lHTTPOnClose不生效,我只能把close写到
The text was updated successfully, but these errors were encountered: