ऐसा लगता है कि सफारी 10.1 में वेबसॉकेट एपीआई में अधिकतम मात्रा में द्विआधारी डेटा है जो इसे बफर कर सकता है और फिर भेजा गया अगला संदेश त्रुटि प्राप्त करता है "वेबसॉकेट कनेक्शन ... विफल: वेबसॉकेट फ्रेम भेजने में विफल।"सफारी के आसपास कैसे काम करें 10.1 त्रुटि "वेबसॉकेट फ्रेम भेजने में विफल"?
सफारी कोड 1006 (CLOSE_ABNORMAL) के साथ कनेक्शन बंद कर देता है।
WebSockets supposed to report the bufferedAmount
हैं - लेकिन सफारी हमेशा 0
रिपोर्ट तक के बाद त्रुटि होती है और कनेक्शन बंद कर दिया है।
मैंने प्रत्येक संदेश के बीच एक सेटटाइमआउट 100ms करने की कोशिश की, और यह डेटा के छोटे हिस्सों के मामले में काम करता प्रतीत होता है, लेकिन ऐसा लगता है कि जब मैं अपना बंद JSON संदेश भेजता हूं, तब भी भंगुर और बड़े हिस्सों में त्रुटियां होती हैं, यहां तक कि अधिक देरी
आप see the bug in action here - "प्ले नमूना" बटन सफारी 10.03 में काम कर सकते हैं लेकिन 10.1 में त्रुटि। (Code that handles the WebSocket connection.)
इस पर काम करने के तरीके पर कोई विचार? या सीमा भी क्या है? मुझे पता है कि सफारी ओपन सोर्स है, लेकिन मुझे यकीन नहीं है कि कहां देखना है।
अद्यतन: यहाँ एक सरल उदाहरण है:
// this fails in Safari 10.1 but works in 10.03 (and other browsers)
var ws = new WebSocket('wss://echo.websocket.org');
ws.onerror = function(evt) {
// Not sure why, but error events seem to have no useful information
// The console, however, will have the following error:
// WebSocket connection to 'wss://echo.websocket.org/' failed: Failed to send WebSocket frame.
console.log("WebSocket error - see console for message");
}
ws.onclose = function(evt) {
console.log(`WebSocket closed with code: ${evt.code}, reason: ${evt.reason}`);
}
ws.onopen = function() {
console.log('sending first binary message');
ws.send(new Uint8Array(23085));
console.log('bufferedAmount is ' + ws.bufferedAmount);
// this gets the error
console.log('sending second binary message');
ws.send(new Uint8Array(23085));
console.log('bufferedAmount is ' + ws.bufferedAmount);
console.log('sending third binary message');
ws.send(new Uint8Array(23085));
console.log('bufferedAmount is ' + ws.bufferedAmount);
ws.close();
}
https://jsfiddle.net/yta2mjuf/2/
दूसरा संदेश एक त्रुटि कनेक्शन बंद कर देता है, और तीसरे संदेश के बाद, bufferedAmount
23093.
मैंने वेबकिट पर एक बग दायर किया: https://bugs.webkit.org/show_bug.cgi?id=170463 –
हम एक ही समस्या का सामना कर रहे हैं। हमारे लिए दहलीज UInt8Array (23085) का बफर प्रतीत होता है; कुछ भी बड़ा है, और हम एक ही त्रुटि देखते हैं। (हम भी bufferedAmount हमेशा रिपोर्टिंग 0 देखते हैं)। क्षमा करें इस समय और अधिक सहायता नहीं हो सकती है - यह नहीं पता कि यह एक सफारी बग या कुछ नई सुरक्षा चीज़ है या नहीं। – MikeB
हमारे पक्ष में वही है, फिक्स के लिए प्रतीक्षा कर रहा है ... –