Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

132
Views
How does the acknowledgement callback function runs on client side in socket.io?

This is the emit Event written on the client-side.

socket.emit('test', 'This is a message', () => {
console.log('Callback Function');
});

This is the broadcaster written on the server-side.

io.on('connection', (socket) => {
socket.on('test', (message, callback) => {
console.log(message);
callback();
})}

Whenever a 'test' event emits from client-side it gets executed on server-side. console.log(message) prints the message 'This is a message' on client-side (basically in express server logs), which is correct. But how does the callback function prints the message 'Callback Function' on browser console, while the callback was called on the server-side?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!