// server main thread: monitor incoming connection allocate buff and create/start new communicating threads communicating thread_read: monitor incoming message(input = userx:message) based on userx, write to buff[x] buff[x].notify communicating thread_write buff[?].wait() write(buff[?])// client write: get user input write to socket read: get socket input update UI.
main thread:
monitor incoming connection
allocate buff and create/start new communicating threads
communicating thread_read:
monitor incoming message(input = userx:message)
based on userx, write to buff[x]
buff[x].notify
communicating thread_write
buff[?].wait()
write(buff[?])// client
write:
get user input
write to socket
read:
get socket input
update UI.