Search completed in 1.17 seconds.
14 results for "onConnect":
SharedWorkerGlobalScope.onconnect - Web APIs
the
onconnect property of the sharedworkerglobalscope interface is an event handler representing the code to be called when the connect event is raised — that is, when a messageport connection is opened between the associated sharedworker and the main thread.
... syntax
onconnect = function() { ...
... }; examples this example shows a shared worker file — when a connection to the worker occurs from a main thread via a messageport, the
onconnect event handler fires.
...And 3 more matches
RTCPeerConnection.onconnectionstatechange - Web APIs
the rtcpeerconnection.
onconnectionstatechange property specifies an eventhandler which is called to handle the connectionstatechange event when it occurs on an instance of rtcpeerconnection.
... syntax rtcpeerconnection.
onconnectionstatechange = eventhandler; value a function which is called by the browser when the connectionstatechange event occurs on the rtcpeerconnection.
... example pc.
onconnectionstatechange = function(event) { switch(pc.connectionstate) { case "connected": // the connection has become fully connected break; case "disconnected": case "failed": // one or more transports has terminated unexpectedly or in an error break; case "closed": // the connection has been closed break; } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.onconn...
USB.onconnect - Web APIs
the
onconnect property of the usb interface is an event handler called whenever a paired device is connected.
... syntax usb.
onconnect = connectfunction specifications specification status comment webusbthe definition of '
onconnect' in that specification.
Index - Web APIs
3434 rtcpeerconnection.
onconnectionstatechange api, connection state, event handler, ice, property, rtcpeerconnection, reference, webrtc,
onconnectionstatechange the rtcpeerconnection.
onconnectionstatechange property specifies an eventhandler which is called to handle the connectionstatechange event when it occurs on an instance of rtcpeerconnection.
... 4006 sharedworkerglobalscope.
onconnect api, property, reference, référence(2), sharedworkerglobalscope, web workers,
onconnect the
onconnect property of the sharedworkerglobalscope interface is an event handler representing the code to be called when the connect event is raised — that is, when a messageport connection is opened between the associated sharedworker and the main thread.
... 4395 usb.
onconnect api, method, reference, usb, webusb, webusb api,
onconnect the
onconnect property of the usb interface is an event handler called whenever a paired device is connected.
MessageEvent - Web APIs
ort.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } myworker.port.onmessage = function(e) { result1.textcontent = e.data; console.log('message received from worker'); } inside the worker we use the sharedworkerglobalscope.
onconnect handler to connect to the same port discussed above.
...
onconnect = function(e) { var port = e.ports[0]; port.addeventlistener('message', function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); }); port.start(); // required when using addeventlistener.
RTCPeerConnection: connectionstatechange event - Web APIs
bubbles no cancelable no interface event event handler
onconnectionstatechange examples for an rtcpeerconnection, pc, this example sets up a handler for connectionstatechange messages to handle changes to the connectivity of the webrtc session.
... pc.
onconnectionstatechange = ev => { switch(pc.connectionstate) { case "new": case "checking": setonlinestatus("connecting..."); break; case "connected": setonlinestatus("online"); break; case "disconnected": setonlinestatus("disconnecting..."); break; case "closed": setonlinestatus("offline"); break; case "failed": setonlinestatus("error"); break; default: setonlinestatus("unknown"); break; } } you can also create a handler for connectionstatechange by using addeventlistener(): pc.addeventlistener("connectionstatechange", ev => { switch(pc.connectionstate) { /* ...
RTCPeerConnection - Web APIs
the event is sent immediately after the call setremotedescription() and doesn't wait for the result of the sdp negotiation.
onconnectionstatechangethe rtcpeerconnection.
onconnectionstatechange property specifies an eventhandler which is called to handle the connectionstatechange event when it occurs on an instance of rtcpeerconnection.
... also available through the
onconnectionstatechange event handler property.
SharedWorker - Web APIs
ort.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } myworker.port.onmessage = function(e) { result1.textcontent = e.data; console.log('message received from worker'); } inside the worker we use the sharedworkerglobalscope.
onconnect handler to connect to the same port discussed above.
...
onconnect = function(e) { var port = e.ports[0]; port.addeventlistener('message', function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); }); port.start(); // required when using addeventlistener.
SharedWorkerGlobalScope: connect event - Web APIs
bubbles no cancelable no interface messageevent event handler property sharedworkerglobalscope.
onconnect examples this example shows a shared worker file — when a connection to the worker occurs from a main thread via a messageport, the
onconnect event handler fires.
... self.
onconnect = function(e) { var port = e.ports[0]; port.onmessage = function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); } port.start(); } for a complete running example, see our basic shared worker example (run shared worker.) addeventlistener equivalent you could also set up an event handler using the addeventlistener() method: self.addeventlistener('connect', function(e) { var port = e.
SharedWorkerGlobalScope - Web APIs
sharedworkerglobalscope.
onconnect is an eventhandler representing the code to be called when the connect event is raised — that is, when a messageport connection is opened between the associated sharedworker and the main thread.
... also available via the
onconnect property.
Sqlite.jsm
shrinkmemory
onconnectionidlems (optional) if defined, the connection will attempt to minimize its memory usage after this many milliseconds of connection idle.
MessageEvent.ports - Web APIs
example
onconnect = function(e) { var port = e.ports[0]; port.addeventlistener('message', function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); }); port.start(); // required when using addeventlistener.
USB - Web APIs
event handlers usb.
onconnect an event handler called whenever a previously paired device is connected.
Using Web Workers - Web APIs
there is a bit more complexity here as well (worker.js):
onconnect = function(e) { var port = e.ports[0]; port.onmessage = function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); } } first, we use an
onconnect handler to fire code when a connection to the port happens (i.e.