We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Following code doesn't generate any errors or warnings, but con.send does not trigger con.on('data',fn) on the remote peer application.
const peer = new Peer(); peer.on('open',(id)=>{ console.log("Your peer id: "+id); firebase.firestore().doc("peers/"+phoneNumber).set({ phoneNumber, id, timestamp: Date.now() }); firebase.firestore().collection("peers").onSnapshot(snap=>{ snap.forEach(doc=>{ let data = doc.data(); if(data.phoneNumber==phoneNumber) return; console.log(data.id); let conn = peer.connect(data.id,{ label: data.phoneNumber, serialization:'json' }); }) }); }) peer.on("connection",(conn)=>{ conn.on('open', function() { console.log(`Connected to ${conn.peer}`); conn.send({ value: 'hello' }); console.log("Sent"); }); conn.on('data', function(data) { console.log('Received', data); }); conn.on('error',(error)=>{ console.log(`Peer error on ${conn.label} (${conn.id}): ${error}`); }) }) peer.on('close',()=>{ console.log("Connection was closed"); }) peer.on('disconnected',()=>{ console.log("Got disconnected"); }) peer.on('error',(err)=>{ console.log("Peer error occurred: ",err.type); })
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Following code doesn't generate any errors or warnings, but con.send does not trigger con.on('data',fn) on the remote peer application.
The text was updated successfully, but these errors were encountered: