الصيغة
أسماء بديلة
WebSocket.Connectwebsocket.connectwebsocket.Connect
تنشئ BindableEvents عددها اثنان، وتفتح WebSocket client WebSocket connection إلى URL المقدم، وتعمل yield حتى تنتهي محاولة الاتصال. عند النجاح، تعيد WebSocket table تحتوي OnMessage و OnClose events، و Send و Close methods من methods، و connection state. يتم إطلاق incoming message data عبر OnMessage كسلسلة string. عندما تنتهي receive loop، يتم إطلاق OnClose بدون arguments. عند فشل الاتصال، ترفع الدالة error string يبدأ بـ “WebSocket connection failed”.
WebSocket.Connectwebsocket.connectwebsocket.Connect