Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Design question about voice chat program.

Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My questions involve singing in, and making sure a client is still logged on.

First, how should clients log onto the server? TCP or UDP?

TCP is connection oriented, so once I sign-in, the connection is always there, I can always check the status of the connection to know the status of the user.
Drawback is, it's costly maintaining a connection, specially as I get more users online.

UDP will require me to send ONE given packet to sign-in (assuming it arrives), but then, how do I update the server on my status status? Does the client send a message to the server every now and then to stay alive?

What if two users are chatting and one logs out? Should the client who logged out send a UDP packet to the server so that the server knows it logged out? Who should message the other client that was being chatted with?
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic