Working on handling received messages. Open a session.
This commit is contained in:
@@ -63,7 +63,12 @@ export async function load_ae_obj_id__event_session(
|
||||
});
|
||||
|
||||
if (log_lvl) {
|
||||
console.log('ae_promises.load__event_session_obj:', ae_promises.load__event_session_obj);
|
||||
console.log('ae_promises.load__event_session_obj:', ae_promises?.load__event_session_obj);
|
||||
}
|
||||
|
||||
if (ae_promises?.load__event_session_obj === null) {
|
||||
console.log('No results returned.');
|
||||
return null;
|
||||
}
|
||||
|
||||
if (inc_file_li) {
|
||||
|
||||
@@ -55,13 +55,13 @@ function ws_connect_group_id({group_id, client_id}) {
|
||||
'status': 'connected'
|
||||
});
|
||||
|
||||
ws_connection.send(JSON.stringify({
|
||||
client_id: client_id,
|
||||
target: 'echo',
|
||||
type: 'hello',
|
||||
group_id: group_id,
|
||||
msg: 'You are connected!'
|
||||
}));
|
||||
// ws_connection.send(JSON.stringify({
|
||||
// client_id: client_id,
|
||||
// target: 'echo',
|
||||
// type: 'hello',
|
||||
// group_id: group_id,
|
||||
// msg: 'You are connected!'
|
||||
// }));
|
||||
|
||||
ws_connection.send(JSON.stringify({
|
||||
client_id: client_id,
|
||||
@@ -73,11 +73,14 @@ function ws_connect_group_id({group_id, client_id}) {
|
||||
};
|
||||
|
||||
ws_connection.onmessage = function(event) {
|
||||
console.log('WS: message received');
|
||||
console.log(event);
|
||||
if (log_lvl) {
|
||||
console.log('WS: message received', event);
|
||||
}
|
||||
|
||||
let ws_recv_data = JSON.parse(event.data);
|
||||
console.log(ws_recv_data);
|
||||
if (log_lvl) {
|
||||
console.log('WS: Received data:', ws_recv_data);
|
||||
}
|
||||
|
||||
if (client_id == ws_recv_data.client_id) {
|
||||
if (log_lvl) {
|
||||
|
||||
Reference in New Issue
Block a user