Open BaibhavTiwari opened 2 weeks ago
Socket Initialization CORS Configuration:
cors: true
Broadcasting Events to All Clients (io.emit):
io.emit
Unnecessary and Unused Variables (RoomU1, RoomU2):
RoomU1
RoomU2
Missing Disconnect Handling:
disconnect
Inconsistent Room Management:
socket.join()
socket.leave()
Memory Leaks Due to Multiple Connections:
No Error Handling for Invalid Data:
Send_RoomJoin_Req
Event Key Naming Conflicts:
to
from
Send_Offer
Send_Ans
Best of luck
Socket Initialization CORS Configuration:
cors: true
, which is insufficient for complex cross-origin setups. A more specific configuration is needed.Broadcasting Events to All Clients (
io.emit
):io.emit
is used to broadcast events to all clients instead of targeting specific ones. This leads to unnecessary emissions.Unnecessary and Unused Variables (
RoomU1
,RoomU2
):RoomU1
andRoomU2
are commented out and unused, cluttering the code.Missing Disconnect Handling:
disconnect
events, which could lead to resource leaks or improperly handled socket disconnections.Inconsistent Room Management:
socket.join()
andsocket.leave()
) is not being used effectively.Memory Leaks Due to Multiple Connections:
No Error Handling for Invalid Data:
Send_RoomJoin_Req
, which could result in undefined behavior.Event Key Naming Conflicts:
to
andfrom
in events likeSend_Offer
andSend_Ans
may cause confusion and need better naming conventions.