javascript - Create websocket without connecting -


is there way create websocket without connecting right away? far think

var ws = new websocket("ws://ws.my.url.com"); 

creates , connects right away.

i'd create socket, define callbacks, , connect once user clicks connect button.

thanks

no. creating websocket means you've created connection server (or started process of connecting). there no such thing creating websocket isn't connecting yet.

you create object store configuration parameters , tell object connect when wanted to, though i'm not sure why that's better creating actual websocket when connect made.

or create function setup work , call function later when user clicks connect button.


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -