Hello everyone,

I'm working on a chat/server solution, and the plan is for it to have both text and voice communication. Now, since the same server will power both functions, I was wondering wether I can reuse my socket with accompanying receive method to transfer both text and voice, or wether it needs to be a new socket and streams; on both server and client side?

In short, can I receive two types of Data through a DataInputStream, differentiate between them by type and route them through the correct output, or do I need write a new thread to handle voice input? If this is possible, is there any risk of lag/hickups if the user decides to spam text while talking?